forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reproduce Regression after 576ba7c: io.vertx.core.http.HttpServerRequ…
…est.absoluteURI() does not contain port anymore quarkusio#44776
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...ns/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/AllowXForwardedHostTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.quarkus.vertx.http; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class AllowXForwardedHostTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(ForwardedHandlerInitializer.class) | ||
.addAsResource(new StringAsset( | ||
"quarkus.http.proxy.proxy-address-forwarding=true\n" | ||
+ "quarkus.http.proxy.enable-forwarded-host=true\n"), | ||
"application.properties")); | ||
|
||
@Test | ||
public void testXForwardedProtoOverridesForwardedProto() { | ||
assertThat(RestAssured.get("/path").asString()).startsWith("http|"); | ||
|
||
RestAssured.given() | ||
.header("X-Forwarded-Host", "foo") | ||
.get("/path") | ||
.then() | ||
.body( | ||
Check failure on line 32 in extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/AllowXForwardedHostTest.java GitHub Actions / Build summary for 50434813532ff5611a05f92c947ed5ffa72848adJVM Tests - JDK 17
Raw output
Check failure on line 32 in extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/AllowXForwardedHostTest.java GitHub Actions / Build summary for 50434813532ff5611a05f92c947ed5ffa72848adJVM Tests - JDK 17 Windows
Raw output
Check failure on line 32 in extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/AllowXForwardedHostTest.java GitHub Actions / Build summary for 50434813532ff5611a05f92c947ed5ffa72848adJVM Tests - JDK 21
Raw output
|
||
Matchers.startsWith("http|foo:8081|"), | ||
Matchers.endsWith("|/path|http://foo:8081/path")); | ||
} | ||
|
||
} |