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

ContextPathCompositeHandler returns 200 when no path found [SPR-17144] #21681

Closed
spring-issuemaster opened this issue Aug 8, 2018 · 2 comments
Closed
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Aug 8, 2018

Marius Rubin opened SPR-17144 and commented

In scenarios where a call to a WebFlux application using ContextPathCompositeHandler do not match against a context path then the response can still be status code 200, rather than 404.

It looks like this is because the ContextPathCompositeHandler calls response.setComplete() but returns Mono.empty() when no handlers for a given path have been found.

This results in the callback chain for response.setComplete(), including the commit, and applyStatusCode() invocation to be discarded.

As a result, while the response status has been set to 404, this is not what gets written to outbound buffer.

This project: https://github.com/maubergine/cpch-bug-example illustrates the issue and the effect of updating the code (PR to be raised shortly).


Affects: 5.0.8, 5.1 RC1

Referenced from: pull request #1921

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 8, 2018

Marius Rubin commented

PR created: #1921

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 8, 2018

Rossen Stoyanchev commented

This should be fixed now. Thanks for the analysis and repro project!

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.