liubao68 closed pull request #616: [SCB-420] change default HTTP header size 
limitation to 32K
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/616
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
 
b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
index 75bcc98af..fee033c21 100644
--- 
a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
+++ 
b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
@@ -21,9 +21,17 @@
 import com.netflix.config.DynamicPropertyFactory;
 import com.netflix.config.DynamicStringProperty;
 
-import io.vertx.core.http.HttpServerOptions;
-
 public final class TransportConfig {
+
+  public static final int DEFAULT_SERVER_THREAD_COUNT = 1;
+
+  public static final int DEFAULT_SERVER_CONNECTION_IDLE_TIMEOUT_SECOND = 60;
+
+  public static final boolean DEFAULT_SERVER_COMPRESSION_SUPPORT = false;
+
+  // 32K
+  public static final int DEFAULT_SERVER_MAX_HEADER_SIZE = 32 * 1024;
+
   private TransportConfig() {
   }
 
@@ -35,25 +43,27 @@ public static String getAddress() {
 
   public static int getThreadCount() {
     DynamicIntProperty address =
-        
DynamicPropertyFactory.getInstance().getIntProperty("cse.rest.server.thread-count",
 1);
+        DynamicPropertyFactory.getInstance()
+            .getIntProperty("cse.rest.server.thread-count", 
DEFAULT_SERVER_THREAD_COUNT);
     return address.get();
   }
 
   public static int getConnectionIdleTimeoutInSeconds() {
     return DynamicPropertyFactory.getInstance()
-        .getIntProperty("cse.rest.server.connection.idleTimeoutInSeconds", 60)
+        .getIntProperty("cse.rest.server.connection.idleTimeoutInSeconds",
+            DEFAULT_SERVER_CONNECTION_IDLE_TIMEOUT_SECOND)
         .get();
   }
 
   public static boolean getCompressed() {
     return DynamicPropertyFactory.getInstance()
-        .getBooleanProperty("cse.rest.server.compression", false)
+        .getBooleanProperty("cse.rest.server.compression", 
DEFAULT_SERVER_COMPRESSION_SUPPORT)
         .get();
   }
 
   public static int getMaxHeaderSize() {
     return DynamicPropertyFactory.getInstance()
-        .getIntProperty("cse.rest.server.maxHeaderSize", 
HttpServerOptions.DEFAULT_MAX_HEADER_SIZE)
+        .getIntProperty("cse.rest.server.maxHeaderSize", 
DEFAULT_SERVER_MAX_HEADER_SIZE)
         .get();
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to