mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
perf(core): look up the authority only for an HTTP/1.0 request in the missing Host check (#8443)
This commit is contained in:
1 parent
e9f842765d
commit
f5e08d5e9c
2 files changed
+20
-2
No files matched your search
@@ -2,6 +2,7 @@ package io.floci.aws.core.common;
|
||||
|
||||
import io.quarkus.vertx.http.runtime.CurrentVertxRequest;
|
||||
import io.vertx.core.http.HttpServerRequest;
|
||||
import io.vertx.core.http.HttpVersion;
|
||||
import io.vertx.core.net.SocketAddress;
|
||||
import io.vertx.ext.web.RoutingContext;
|
||||
import jakarta.annotation.Priority;
|
||||
@@ -68,9 +69,11 @@ public class MissingHostHeaderFilter implements ContainerRequestFilter {
|
||||
if (routingContext == null) {
|
||||
return;
|
||||
}
|
||||
// An HTTP/2 request has no Host header either, but carries :authority, which Vert.x
|
||||
// surfaces here. A null authority is the one case with nothing to route by.
|
||||
HttpServerRequest request = routingContext.request();
|
||||
// vertx-web answers 400 to any other version without a valid authority before a filter runs.
|
||||
if (request.version() != HttpVersion.HTTP_1_0) {
|
||||
return;
|
||||
}
|
||||
if (request.authority() != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user