Jetty9: unhandled response should be counted as 404 and not 200 #1232
Conversation
In Jetty, a request that has not been handled by the handler chain keeps the default status code 200, and a 404 response is produced by HttpChannel. The Jetty9 InstrumentedHandler therefore has to count unhandled request as 404.
Thanks for spotting this bug! I agree that an unhandled request should be counted as an error (because there's no handler that handles the request). I'm still maintaining the 3.2 branch, so the fix is good enough to merge to it. I will also cherry-pick it to the 4.0 branch. |
68087f9
into
dropwizard:3.2-development
1 check passed
1 check passed
Awesome! Thanks @arteam! |
arteam
added a commit
that referenced
this pull request
Jan 5, 2018
In Jetty, a request that has not been handled by the handler chain keeps the default status code 200, and a 404 response is produced by HttpChannel. The Jetty9 InstrumentedHandler therefore has to count unhandled request as 404. (cherry picked from commit 68087f9)
arteam
added a commit
that referenced
this pull request
Jan 5, 2018
In Jetty, a request that has not been handled by the handler chain keeps the default status code 200, and a 404 response is produced by HttpChannel. The Jetty9 InstrumentedHandler therefore has to count unhandled request as 404. (cherry picked from commit 68087f9) (cherry picked from commit 5481990)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
In Jetty, a request that has not been handled by the handler chain keeps the default status code 200, and a 404 response is produced by
HttpChannel
. The Jetty9InstrumentedHandler
therefore has to count unhandled request as 404 and not 200.To reveal the issue, this PR removes the 404 response from
InstrumentedHandlerTest.TestHandler
so that a request to/hello
ends up not being handled.This PR is against branch
3.2-development
. Should I open another PR for branch4.0-development
?