From bf80fc62d5cf21ca8ee29af2ef48929dfc1aa2f5 Mon Sep 17 00:00:00 2001 From: Linary Date: Thu, 19 Nov 2020 17:44:18 +0800 Subject: [PATCH] Remove restserver.protocol option (#1272) Change-Id: I57a90e5a3254e22f29243beebf81751182d15534 --- .../com/baidu/hugegraph/config/ServerOptions.java | 11 +---------- .../java/com/baidu/hugegraph/server/RestServer.java | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/config/ServerOptions.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/config/ServerOptions.java index 71fb6b7159..f5a5e3c289 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/config/ServerOptions.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/config/ServerOptions.java @@ -49,15 +49,6 @@ public static synchronized ServerOptions instance() { "http://127.0.0.1:8080" ); - public static final ConfigOption REST_SERVER_PROTOCOL = - new ConfigOption<>( - "restserver.protocol", - "The protocol of rest-server, allowed values are: " + - "http or https.", - allowValues("http", "https"), - "http" - ); - public static final ConfigOption SERVER_ID = new ConfigOption<>( "server.id", @@ -237,7 +228,7 @@ public static synchronized ServerOptions instance() { "The path of server keystore file used when https " + "protocol is enabled.", disallowEmpty(), - "hugegraph-server.keystore" + "conf/hugegraph-server.keystore" ); public static final ConfigOption SSL_KEYSTORE_PASSWORD = diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/server/RestServer.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/server/RestServer.java index d4d2368888..2895083039 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/server/RestServer.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/server/RestServer.java @@ -70,7 +70,7 @@ public void start() throws IOException { } private HttpServer configHttpServer(URI uri, ResourceConfig rc) { - String protocol = this.conf.get(ServerOptions.REST_SERVER_PROTOCOL); + String protocol = uri.getScheme(); final HttpServer server; if (protocol != null && protocol.equals("https")) { SSLContextConfigurator sslContext = new SSLContextConfigurator();