-
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.
Support path and method for the header
Signed-off-by: George Gastaldi <[email protected]>
- Loading branch information
Showing
8 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HeaderConfig.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,32 @@ | ||
package io.quarkus.vertx.http.runtime; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
/** | ||
* Configuration that allows for setting an HTTP header | ||
*/ | ||
@ConfigGroup | ||
public class HeaderConfig { | ||
|
||
/** | ||
* The path this header should be applied | ||
*/ | ||
@ConfigItem(defaultValue = "/*") | ||
public String path; | ||
|
||
/** | ||
* The value for this header configuration | ||
*/ | ||
@ConfigItem | ||
public String value; | ||
|
||
/** | ||
* The HTTP methods for this header configuration | ||
*/ | ||
@ConfigItem | ||
public Optional<List<String>> methods; | ||
} |
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
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
28 changes: 28 additions & 0 deletions
28
integration-tests/vertx-http/src/main/java/io/quarkus/it/vertx/HeaderResource.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,28 @@ | ||
package io.quarkus.it.vertx; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Path("/headers") | ||
public class HeaderResource { | ||
|
||
@GET | ||
@Path("/any") | ||
public String headers() { | ||
return "ok"; | ||
} | ||
|
||
@GET | ||
@Path("/pragma") | ||
public String pragmaHeaderMustBeSet() { | ||
return "ok"; | ||
} | ||
|
||
@GET | ||
@Path("/override") | ||
public Response headersOverride() { | ||
return Response.ok("ok").header("foo", "abc").build(); | ||
} | ||
|
||
} |
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
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
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