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

Prevent creation of the Response object by ContainerResponseContext #45798

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jan 22, 2025

@geoand geoand changed the title Prevent creation of the Response object for ContainerResponseContext Prevent creation of the Response object by ContainerResponseContext Jan 22, 2025
}

@Override
public Object getEntity() {
return response().getEntity();
return transientResponse().getEntity();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tricky part is that it not only affects the hasEntity() or getEntity() methods, it affects every method that calls response() LazyResponse, eg. I face this issue with getHeaders().

While debugging this, I found this comment:

// FIXME: custom status codes depending on method?
responseBuilder = ResponseBuilderImpl.ok(result);

Seems that here is where the status code is set to 200.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eg. I face this issue with getHeaders().

Yes I know, hence the draft status of the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Range response status reset when using a @ServerResponseFilter
2 participants