-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29e9cc6
commit cd28056
Showing
4 changed files
with
46 additions
and
11 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...x-http/deployment/src/test/java/io/quarkus/vertx/http/cors/CORSRegexWildcardTestCase.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,27 @@ | ||
package io.quarkus.vertx.http.cors; | ||
|
||
import static io.restassured.RestAssured.given; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class CORSRegexWildcardTestCase { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest runner = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(BeanRegisteringRoute.class) | ||
.addAsResource("conf/cors-regex-wildcard.properties", "application.properties")); | ||
|
||
@Test | ||
public void corsRegexValidOriginTest() { | ||
given().header("Origin", "https://asdf.domain.com") | ||
.when() | ||
.get("/test").then() | ||
.statusCode(200) | ||
.header("Access-Control-Allow-Origin", "https://asdf.domain.com") | ||
.header("Access-Control-Allow-Credentials", "false"); | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
extensions/vertx-http/deployment/src/test/resources/conf/cors-regex-wildcard.properties
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,2 @@ | ||
quarkus.http.cors=true | ||
quarkus.http.cors.origins=/.*/ |
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