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

200 OK returned where 206 Partial Content expected #37528

Open
Maldivia opened this issue Dec 5, 2023 · 1 comment
Open

200 OK returned where 206 Partial Content expected #37528

Maldivia opened this issue Dec 5, 2023 · 1 comment
Labels
area/rest kind/bug Something isn't working

Comments

@Maldivia
Copy link
Contributor

Maldivia commented Dec 5, 2023

Describe the bug

Bug report for #37205 / #37213,

The 206 response code in ServerFileBodyHandler.sendFile is not always used if there is a Response already present in the context for instance from ResponseHandler.

I tried adding the below code to ServerFileBodyHandler.sendFile and it worked on my end, but it seem a bit hackish, so raising it as an issue here to get some people with better contextual knowledge to look if this approach is OK.

        Response response = ctx.getResponse().get();
        if (response instanceof ResponseImpl responseImpl) {
            responseImpl.setStatus(Response.Status.PARTIAL_CONTENT.getStatusCode());
        } else {
            ctx.setResponse(new LazyResponse.Existing(Response.fromResponse(response)
                    .status(Response.Status.PARTIAL_CONTENT.getStatusCode())
                    .build()));
        }

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

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

Copy link

quarkus-bot bot commented Dec 6, 2023

/cc @FroMage (resteasy-reactive), @stuartwdouglas (resteasy-reactive)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants