Skip to content
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

REST Client not sending headers when using InputStream #39697

Closed
dominikrebhan opened this issue Mar 26, 2024 · 2 comments
Closed

REST Client not sending headers when using InputStream #39697

dominikrebhan opened this issue Mar 26, 2024 · 2 comments
Labels
area/rest-client kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@dominikrebhan
Copy link

Describe the bug

With Quarkus 3.8.3 the REST Client won't send any headers when the input is an InputStream. I think this is related to #39265

Expected behavior

Send input headers as before or when using no InputStreama as input.

Actual behavior

No headers are sent.

How to Reproduce?

`private final Client client = ClientBuilder.newClient();

@GET
@Path("bytes")
@Produces(MediaType.TEXT_PLAIN)
public int testWithBytes() throws Exception {
    var response = client.target("http://192.168.2.172:9090")
            .path("/")
            .request()
            .header("X-Test", "FOO")
            .post(Entity.entity("Hello World".getBytes(StandardCharsets.UTF_8),
                    "text/plain"));

    return response.getStatus();
}

@GET
@Path("stream")
@Produces(MediaType.TEXT_PLAIN)
public int testWithStream() throws Exception {
    var response = client.target("http://192.168.2.172:9090")
            .path("/")
            .request()
            .header("X-Test", "FOO")
            .post(Entity.entity(new ByteArrayInputStream("Hello World".getBytes(StandardCharsets.UTF_8)),
                    "text/plain"));

    return response.getStatus();
}`
Bildschirmfoto 2024-03-26 um 13 00 13 Bildschirmfoto 2024-03-26 um 13 00 05

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.8.3

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

No response

Additional information

No response

@dominikrebhan dominikrebhan added the kind/bug Something isn't working label Mar 26, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 26, 2024

/cc @cescoffier (rest-client), @geoand (rest-client)

@geoand
Copy link
Contributor

geoand commented Mar 26, 2024

This has already been fixed in main and will be available with the next 3.8 release

@geoand geoand closed this as completed Mar 26, 2024
@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

2 participants