Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2016-01-25 20:23:41 +0000
committerJoakim Erdfelt2016-01-25 20:23:41 +0000
commite3dd0cb83be2df2470595b272dc740a538b7c8f1 (patch)
tree0c6ccf955d4c03473fdde6694ecfc82d13b73116 /jetty-server/src/main
parent734d18fb93da4f363acca96bd78ca6ca0f4b577b (diff)
downloadorg.eclipse.jetty.project-e3dd0cb83be2df2470595b272dc740a538b7c8f1.tar.gz
org.eclipse.jetty.project-e3dd0cb83be2df2470595b272dc740a538b7c8f1.tar.xz
org.eclipse.jetty.project-e3dd0cb83be2df2470595b272dc740a538b7c8f1.zip
486511 - Server.getURI() returns wrong scheme on SSL/HTTPS
Diffstat (limited to 'jetty-server/src/main')
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/Server.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
index 1d81e6a615..51c145d606 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
@@ -654,7 +654,6 @@ public class Server extends HandlerWrapper implements Attributes
/**
* @return The URI of the first {@link NetworkConnector} and first {@link ContextHandler}, or null
*/
- @SuppressWarnings("resource")
public URI getURI()
{
NetworkConnector connector=null;
@@ -674,7 +673,10 @@ public class Server extends HandlerWrapper implements Attributes
try
{
- String scheme=connector.getDefaultConnectionFactory().getProtocol().startsWith("SSL-")?"https":"http";
+ String protocol = connector.getDefaultConnectionFactory().getProtocol();
+ String scheme="http";
+ if (protocol.startsWith("SSL-") || protocol.equals("SSL"))
+ scheme = "https";
String host=connector.getHost();
if (context!=null && context.getVirtualHosts()!=null && context.getVirtualHosts().length>0)

Back to the top