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
Headers set with @HeaderParam ignored by DefaultClientHeadersFactoryImpl #25619
Comments
Which rest client extension are you using? |
Reactive (JSONB) |
If the issue is in the MicroProfile class, I think it's best to report it there. Can you create a simple reproducer? |
@michalszynkiewicz I am not sure it is. Is the I just had a look at the history (https://github.com/eclipse/microprofile-rest-client/commits/master/api/src/main/java/org/eclipse/microprofile/rest/client/ext/DefaultClientHeadersFactoryImpl.java) of the class in MP and it never took on |
I'll dig into it, can you create a small reproducer? |
I have created https://github.com/softmetz/quarkusio-25619-header-propagation There are two test cases, one calling an public endpoint and one a secured one using a bearer token. The latter one will fail, because the value of
Please note, that I used 2.9.1, so the problem is still there. |
The classic REST client behaves exactly the same as the reactive one in this scenario. The difference in the behavior that you observe comes from the fact that REST Client Reactive (RCR) always registers the I'll create a pull request to fix RCR to follow the spec. |
…ient Reactive fixes quarkusio#25619
…ient Reactive fixes quarkusio#25619
…ient Reactive fixes quarkusio#25619 (cherry picked from commit ef59491)
Describe the bug
If a header set via
@HeaderParam
has the same name as a propagated header coming via incoming request, the incoming value overwrites the value set via annotation.I debugged into
org.eclipse.microprofile.rest.client.ext.DefaultClientHeadersFactoryImpl
and found out, that in methodupdate
the value of the annotated parameter is inclientOutgoingHeaders
which is not used at all.Expected behavior
The parameter bound via annotation
@HeaderParam
should have a higher priority that the incoming headerActual behavior
The incoming header gets used instead of the one given via
@HeaderParam
How to Reproduce?
void something(@HeaderParam("authorization") String authorizationHeader);
authorization
headerOutput of
uname -a
orver
Linux nb0mws009 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment (build 17.0.3+7-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 17.0.3+7-Debian-1deb11u1, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.9.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Java version: 17.0.3, vendor: Debian, runtime: /usr/lib/jvm/java-17-openjdk-amd64 Default locale: de_DE, platform encoding: UTF-8 OS name: "linux", version: "5.10.0-14-amd64", arch: "amd64", family: "unix"
Additional information
No response
The text was updated successfully, but these errors were encountered: