Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.IOException;
import java.util.HashSet;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
Expand All @@ -16,9 +17,11 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.logging.Logger;

import io.netty.handler.codec.http.HttpHeaderNames;
import io.quarkus.runtime.configuration.MemorySize;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.buffer.Buffer;
Expand Down Expand Up @@ -71,6 +74,11 @@ public void start(int port) {
vertx = Vertx.vertx(new VertxOptions().setMaxWorkerExecuteTime(60).setMaxWorkerExecuteTimeUnit(TimeUnit.MINUTES));
HttpServerOptions options = new HttpServerOptions();
options.setPort(port == 0 ? -1 : port);
Optional<MemorySize> maybeMaxHeadersSize = ConfigProvider.getConfig()
.getOptionalValue("quarkus.http.limits.max-header-size", MemorySize.class);
if (maybeMaxHeadersSize.isPresent()) {
options.setMaxHeaderSize(maybeMaxHeadersSize.get().asBigInteger().intValueExact());
}
httpServer = vertx.createHttpServer(options);
router = Router.router(vertx);
setupRoutes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import jakarta.enterprise.inject.spi.CDI;

import org.crac.Resource;
import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.logging.Logger;

import io.netty.bootstrap.ServerBootstrap;
Expand Down Expand Up @@ -1535,7 +1536,7 @@ public void initChannel(VirtualChannel ch) throws Exception {
return duplicated;
},
null,
new HttpServerOptions(),
createVirtualHttpServerOptions(),
chctx,
rootContext,
"localhost",
Expand All @@ -1546,6 +1547,16 @@ public void initChannel(VirtualChannel ch) throws Exception {

ch.pipeline().addLast("handler", handler);
}

private static HttpServerOptions createVirtualHttpServerOptions() {
var result = new HttpServerOptions();
Optional<MemorySize> maybeMaxHeadersSize = ConfigProvider.getConfig()
.getOptionalValue("quarkus.http.limits.max-header-size", MemorySize.class);
if (maybeMaxHeadersSize.isPresent()) {
result.setMaxHeaderSize(maybeMaxHeadersSize.get().asBigInteger().intValueExact());
}
return result;
}
});

// Start the server.
Expand Down
Loading