Skip to content

Custom User-Agent header ignored #36329

Description

@luca-vercelli

Describe the bug

We have a reactive rest client where we set a custom User-Agent header via the @ClientHeaderParam annotation.
However this is ignored and replaced with "Resteasy Reactive Client".

This does not happen with legacy resteasy client.

See also issue #23966. In that issue a workaround is described (using a ClientHeadersFactory).

Expected behavior

The HTTP call should include the header User-Agent: my-custom-header

Actual behavior

The HTTP call includes the header User-Agent: Resteasy Reactive Client

How to Reproduce?

You need any rest client

@Path("/somepath")
@ClientHeaderParam(name = "User-Agent", value = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11") 
@RegisterRestClient
public interface MyApi {

  @GET
  Response somepath();

}

and call it via

@Inject
@RestClient
MyApi  api;

....
api.somepath()

Output of uname -a or ver

Microsoft Windows [Versione 10.0.19045.3208]

Output of java -version

java version "11.0.18" 2023-01-17 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.4.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions