You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a reactive rest client where we set a custom User-Agent header. The user agent needs to be this specific value for the API to accept our request.
Unfortunately, it seems that Quarkus versions >= 2.7.0 add an own User-Agent header value with the value: Resteasy Reactive Client. This value is always added, no matter if we set our own User-Agent. So when we make a request the User-Agent header has the values: [Resteasy Reactive Client, Our_Custom_Header_Value] compared to versions <= 2.6.3 where the User-Agent values is [Our_Custom_Header_Value].
A workaround is to add a custom ClientHeadersFactory and register it to above interface. For example:
class GatewayHeadersFactory: ClientHeadersFactory {
override fun update(incomingHeaders: MultivaluedMap<String, String>?, clientOutgoingHeaders: MultivaluedMap<String, String>?): MultivaluedMap<String, String> {
val clientHeaders = MultivaluedHashMap<String, String>()
"Our_Custom_Header_Value".addHeader("User-Agent", clientHeaders)
return clientHeaders
}
}
Expected behavior
The rest client should only add its own User-Agent header when we do not specify our own header. This should apply when the header is set with the @HeaderParam annotation in the method as well as when using @ClientHeaderParam to set a User-Agent header.
Actual behavior
The rest client always adds it's own User-Agent header.
How to Reproduce?
No response
Output of uname -a or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
This issue is based on the Zulip chat: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/io.2Evertx.2Ecore.2Ehttp.2Eimpl.2ENoStackTraceTimeoutException
We have a reactive rest client where we set a custom
User-Agent
header. The user agent needs to be this specific value for the API to accept our request.Unfortunately, it seems that Quarkus versions >= 2.7.0 add an own
User-Agent
header value with the value:Resteasy Reactive Client
. This value is always added, no matter if we set our ownUser-Agent
. So when we make a request theUser-Agent
header has the values:[Resteasy Reactive Client, Our_Custom_Header_Value]
compared to versions <= 2.6.3 where theUser-Agent
values is[Our_Custom_Header_Value]
.A workaround is to add a custom ClientHeadersFactory and register it to above interface. For example:
Expected behavior
The rest client should only add its own
User-Agent
header when we do not specify our own header. This should apply when the header is set with the@HeaderParam
annotation in the method as well as when using@ClientHeaderParam
to set aUser-Agent
header.Actual behavior
The rest client always adds it's own User-Agent header.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: