Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Vert.x 4.4.5 and Netty 4.1.97 #35700

Merged
merged 1 commit into from
Sep 5, 2023
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
6 changes: 3 additions & 3 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<opentelemetry.version>1.28.0</opentelemetry.version>
<opentelemetry-alpha.version>1.28.0-alpha</opentelemetry-alpha.version>
<jaeger.version>1.8.1</jaeger.version>
<quarkus-http.version>5.0.2.Final</quarkus-http.version>
<quarkus-http.version>5.0.3.Final</quarkus-http.version>
<micrometer.version>1.11.1</micrometer.version><!-- keep in sync with hdrhistogram -->
<hdrhistogram.version>2.1.12</hdrhistogram.version><!-- keep in sync with micrometer -->
<google-auth.version>0.22.0</google-auth.version>
Expand Down Expand Up @@ -120,7 +120,7 @@
<wildfly-client-config.version>1.0.1.Final</wildfly-client-config.version>
<wildfly-elytron.version>2.2.2.Final</wildfly-elytron.version>
<jboss-threads.version>3.5.0.Final</jboss-threads.version>
<vertx.version>4.4.4</vertx.version>
<vertx.version>4.4.5</vertx.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
<httpasync.version>4.1.5</httpasync.version>
Expand All @@ -142,7 +142,7 @@
<infinispan.version>14.0.14.Final</infinispan.version>
<infinispan.protostream.version>4.6.2.Final</infinispan.protostream.version>
<caffeine.version>3.1.5</caffeine.version>
<netty.version>4.1.94.Final</netty.version>
<netty.version>4.1.97.Final</netty.version>
<brotli4j.version>1.12.0</brotli4j.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
<jboss-logging.version>3.5.3.Final</jboss-logging.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public static ResteasyUriInfo extractUriInfo(HttpServerRequest req, String conte
if (uri.startsWith(protocol + "://")) {
uriString = uri;
} else {
String host = req.host();
if (host == null) {
host = "unknown";
var authority = req.authority();
if (authority == null) {
uriString = protocol + "//unknown" + uri;
} else {
uriString = protocol + "://" + authority + uri;
}
uriString = protocol + "://" + host + uri;
}

// ResteasyUriInfo expects a context path to start with a "/" character
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.netty.util.AsciiString;
import io.vertx.core.http.HttpHeaders;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.net.HostAndPort;
import io.vertx.core.net.SocketAddress;
import io.vertx.core.net.impl.SocketAddressImpl;

Expand Down Expand Up @@ -60,6 +61,8 @@ class ForwardedParser {
private String absoluteURI;
private SocketAddress remoteAddress;

private HostAndPort authority;

ForwardedParser(HttpServerRequest delegate, ForwardingProxyOptions forwardingProxyOptions,
TrustedProxyCheck trustedProxyCheck) {
this.delegate = delegate;
Expand All @@ -86,6 +89,13 @@ boolean isSSL() {
return scheme.equals(HTTPS_SCHEME);
}

HostAndPort authority() {
if (!calculated) {
calculate();
}
return authority;
}

String absoluteURI() {
if (!calculated)
calculate();
Expand All @@ -111,7 +121,7 @@ private void calculate() {
calculated = true;
remoteAddress = delegate.remoteAddress();
scheme = delegate.scheme();
setHostAndPort(delegate.host(), port);
setHostAndPort(delegate.getHeader(HttpHeaders.HOST), port);
uri = delegate.uri();

if (trustedProxyCheck.isProxyAllowed()) {
Expand Down Expand Up @@ -176,6 +186,7 @@ private void calculate() {
port = -1;
}

authority = HostAndPort.create(host, port >= 0 ? port : -1);
host = host + (port >= 0 ? ":" + port : "");
delegate.headers().set(HttpHeaders.HOST, host);
absoluteURI = scheme + "://" + host + uri;
Expand Down Expand Up @@ -267,4 +278,5 @@ private String stripSlashes(String uri) {

return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.vertx.core.http.StreamPriority;
import io.vertx.core.http.impl.HttpServerRequestInternal;
import io.vertx.core.http.impl.HttpServerRequestWrapper;
import io.vertx.core.net.HostAndPort;
import io.vertx.core.net.NetSocket;
import io.vertx.core.net.SocketAddress;

Expand Down Expand Up @@ -191,6 +192,11 @@ public SocketAddress remoteAddress() {
return forwardedParser.remoteAddress();
}

@Override
public HostAndPort authority() {
return forwardedParser.authority();
}

@Override
public SocketAddress localAddress() {
return delegate.localAddress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.http.StreamPriority;
import io.vertx.core.net.HostAndPort;
import io.vertx.core.streams.ReadStream;

class AbstractResponseWrapper implements HttpServerResponse {
Expand Down Expand Up @@ -323,6 +324,7 @@ public HttpServerResponse sendFile(String filename, long offset, long length,
}

@Override
@Deprecated
public void close() {
delegate.close();
}
Expand Down Expand Up @@ -376,7 +378,7 @@ public HttpServerResponse push(HttpMethod method, String host, String path,

@Override
public Future<HttpServerResponse> push(HttpMethod method, String host, String path) {
return null;
return delegate.push(method, host, path);
}

@Override
Expand All @@ -389,7 +391,7 @@ public HttpServerResponse push(HttpMethod method, String path, MultiMap headers,

@Override
public Future<HttpServerResponse> push(HttpMethod method, String path, MultiMap headers) {
return null;
return delegate.push(method, path, headers);
}

@Override
Expand All @@ -401,7 +403,7 @@ public HttpServerResponse push(HttpMethod method, String path, Handler<AsyncResu

@Override
public Future<HttpServerResponse> push(HttpMethod method, String path) {
return null;
return delegate.push(method, path);
}

@Override
Expand All @@ -413,8 +415,14 @@ public HttpServerResponse push(HttpMethod method, String host, String path, Mult
}

@Override
@Deprecated
public Future<HttpServerResponse> push(HttpMethod method, String host, String path, MultiMap headers) {
return null;
return delegate.push(method, host, path, headers);
}

@Override
public Future<HttpServerResponse> push(HttpMethod method, HostAndPort authority, String path, MultiMap headers) {
return delegate.push(method, authority, path, headers);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/resteasy-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<mutiny.version>2.3.1</mutiny.version>
<smallrye-common.version>2.1.0</smallrye-common.version>
<vertx.version>4.4.4</vertx.version>
<vertx.version>4.4.5</vertx.version>
<rest-assured.version>5.3.0</rest-assured.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<jackson-bom.version>2.15.2</jackson-bom.version>
Expand Down