You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2023/02/15 15:41:50 UTC

[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19514: [fix] [admin] Admin API can not work if uri too large

poorbarcode commented on code in PR #19514:
URL: https://github.com/apache/pulsar/pull/19514#discussion_r1107295017


##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/WebServer.java:
##########
@@ -214,6 +218,13 @@ public void addServlet(String basePath, ServletHolder servletHolder,
         handlers.add(context);
     }
 
+    private static void popularServletParams(ServletHolder servletHolder, ProxyConfiguration config){
+        if (config.getHttpClientRequestBufferSize() > 0 || config.getHttpMaxRequestHeaderSize() > 0){
+            int v = Math.max(config.getHttpClientRequestBufferSize(), config.getHttpMaxRequestHeaderSize());
+            servletHolder.setInitParameter(INIT_PARAM_REQUEST_BUFFER_SIZE, String.valueOf(v));
+        }
+    }

Review Comment:
   The HTTP client in Jetty will create a ByteBuf which is sized "requestBufferSize" to cache the data of the request line, if the ByteBuf is not enough to handle the data of the request line(contains URI), it will throw a BadMessageException



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org