Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
bf7a7ae4
Verified
Commit
bf7a7ae4
authored
11 months ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Allow plain HTTP
parent
05c7af28
No related branches found
No related tags found
No related merge requests found
Pipeline
#56432
failed
11 months ago
Stage: info
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/caosdb/server/CaosDBServer.java
+28
-6
28 additions, 6 deletions
src/main/java/org/caosdb/server/CaosDBServer.java
with
28 additions
and
6 deletions
src/main/java/org/caosdb/server/CaosDBServer.java
+
28
−
6
View file @
bf7a7ae4
...
...
@@ -545,11 +545,23 @@ public class CaosDBServer extends Application {
// redirector http to https
if
(
port_http
!=
0
)
{
logger
.
info
(
"Redirecting to "
+
port_redirect_https
);
if
(
isHttpToHttpsRedirect
())
{
logger
.
info
(
"Redirecting HTTP "
+
port_http
+
" to HTTPS "
+
port_redirect_https
);
component
.
getServers
()
.
add
(
Protocol
.
HTTP
,
server_bind_address
,
port_http
)
.
setNext
(
new
HttpToHttpsRedirector
(
port_redirect_https
));
}
else
{
final
Server
httpServer
=
new
Server
(
(
Context
)
null
,
Arrays
.
asList
(
Protocol
.
HTTP
),
server_bind_address
,
port_http
,
(
Restlet
)
null
,
"org.restlet.ext.jetty.HttpServerHelper"
);
component
.
getServers
().
add
(
httpServer
);
}
}
// set initial and maximal connections
...
...
@@ -601,6 +613,16 @@ public class CaosDBServer extends Application {
}
}
private
static
boolean
isHttpToHttpsRedirect
()
{
try
{
return
!
getServerProperty
(
ServerProperties
.
KEY_REDIRECT_HTTP_TO_HTTPS_PORT
)
.
equalsIgnoreCase
(
"false"
);
}
catch
(
NullPointerException
e
)
{
return
true
;
}
}
/**
* Specify the dispatching restlet that maps URIs to their associated resources for processing.
*
...
...
@@ -997,7 +1019,7 @@ class CaosDBComponent extends Component {
request
.
getAttributes
().
put
(
"SRID"
,
UUID
.
randomUUID
().
toString
());
response
.
setServerInfo
(
CaosDBServer
.
getServerInfo
());
super
.
handle
(
request
,
response
);
response
.
getHeaders
().
set
(
"
Access
-
Control
-
Allow
-
Origin
"
,
"*"
,
true
);
response
.
setAccessControlAllowOrigin
(
"*"
);
log
(
request
,
response
,
t1
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment