File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
amazon-lambda/event-server/src/main/java/io/quarkus/amazon/lambda/runtime
vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 4
4
import java .io .IOException ;
5
5
import java .util .HashSet ;
6
6
import java .util .Locale ;
7
+ import java .util .Optional ;
7
8
import java .util .Set ;
8
9
import java .util .UUID ;
9
10
import java .util .concurrent .BlockingQueue ;
16
17
import java .util .concurrent .TimeUnit ;
17
18
import java .util .concurrent .atomic .AtomicBoolean ;
18
19
20
+ import org .eclipse .microprofile .config .ConfigProvider ;
19
21
import org .jboss .logging .Logger ;
20
22
21
23
import io .netty .handler .codec .http .HttpHeaderNames ;
24
+ import io .quarkus .runtime .configuration .MemorySize ;
22
25
import io .vertx .core .Vertx ;
23
26
import io .vertx .core .VertxOptions ;
24
27
import io .vertx .core .buffer .Buffer ;
@@ -71,6 +74,11 @@ public void start(int port) {
71
74
vertx = Vertx .vertx (new VertxOptions ().setMaxWorkerExecuteTime (60 ).setMaxWorkerExecuteTimeUnit (TimeUnit .MINUTES ));
72
75
HttpServerOptions options = new HttpServerOptions ();
73
76
options .setPort (port == 0 ? -1 : port );
77
+ Optional <MemorySize > maybeMaxHeadersSize = ConfigProvider .getConfig ()
78
+ .getOptionalValue ("quarkus.http.limits.max-header-size" , MemorySize .class );
79
+ if (maybeMaxHeadersSize .isPresent ()) {
80
+ options .setMaxHeaderSize (maybeMaxHeadersSize .get ().asBigInteger ().intValueExact ());
81
+ }
74
82
httpServer = vertx .createHttpServer (options );
75
83
router = Router .router (vertx );
76
84
setupRoutes ();
Original file line number Diff line number Diff line change 38
38
import jakarta .enterprise .inject .spi .CDI ;
39
39
40
40
import org .crac .Resource ;
41
+ import org .eclipse .microprofile .config .ConfigProvider ;
41
42
import org .jboss .logging .Logger ;
42
43
43
44
import io .netty .bootstrap .ServerBootstrap ;
@@ -1535,7 +1536,7 @@ public void initChannel(VirtualChannel ch) throws Exception {
1535
1536
return duplicated ;
1536
1537
},
1537
1538
null ,
1538
- new HttpServerOptions (),
1539
+ createVirtualHttpServerOptions (),
1539
1540
chctx ,
1540
1541
rootContext ,
1541
1542
"localhost" ,
@@ -1546,6 +1547,16 @@ public void initChannel(VirtualChannel ch) throws Exception {
1546
1547
1547
1548
ch .pipeline ().addLast ("handler" , handler );
1548
1549
}
1550
+
1551
+ private static HttpServerOptions createVirtualHttpServerOptions () {
1552
+ var result = new HttpServerOptions ();
1553
+ Optional <MemorySize > maybeMaxHeadersSize = ConfigProvider .getConfig ()
1554
+ .getOptionalValue ("quarkus.http.limits.max-header-size" , MemorySize .class );
1555
+ if (maybeMaxHeadersSize .isPresent ()) {
1556
+ result .setMaxHeaderSize (maybeMaxHeadersSize .get ().asBigInteger ().intValueExact ());
1557
+ }
1558
+ return result ;
1559
+ }
1549
1560
});
1550
1561
1551
1562
// Start the server.
You can’t perform that action at this time.
0 commit comments