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.
Propagate headers from
@ClientHeaderParam
when using ClientHeadersFact
Fix quarkusio#28738 (cherry picked from commit b773a33)
- Loading branch information
Showing
5 changed files
with
62 additions
and
17 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...t/src/test/java/io/quarkus/rest/client/reactive/registerclientheaders/ComputedHeader.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,9 @@ | ||
package io.quarkus.rest.client.reactive.registerclientheaders; | ||
|
||
public final class ComputedHeader { | ||
|
||
public static String get() { | ||
return "From " + ComputedHeader.class.getName(); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...a/io/quarkus/rest/client/reactive/registerclientheaders/MultipleHeadersBindingClient.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,20 @@ | ||
package io.quarkus.rest.client.reactive.registerclientheaders; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.HeaderParam; | ||
import javax.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; | ||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
@RegisterRestClient | ||
@RegisterClientHeaders(MyHeadersFactory.class) | ||
@ClientHeaderParam(name = "my-header", value = "constant-header-value") | ||
@ClientHeaderParam(name = "computed-header", value = "{io.quarkus.rest.client.reactive.registerclientheaders.ComputedHeader.get}") | ||
public interface MultipleHeadersBindingClient { | ||
@GET | ||
@Path("/describe-request") | ||
@ClientHeaderParam(name = "header-from-properties", value = "${header.value}") | ||
RequestData call(@HeaderParam("jaxrs-style-header") String headerValue); | ||
} |
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