-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty 12.0 beta 2 HttpServletResponse::getStatus returns 0 by default #9955
Comments
Note that if left at 0, then jetty will send a 200 as 0 simple means not set and the default if not set is 200. |
Note that 0 means not set and the default when not set is 200, so 200 will be sent. |
Fix #9955 zero status is 200 in servlet API
Merged in PR #9956 |
Jetty version(s)
Jetty 12.0 beta 2
Description
Running a Servlet in version 12 beta 2,
HttpServletResponse::getStatus
returns0
if a status has not yet been set withsetStatus
.According the Section 6.1.1 of RFC 2616:
0
is not a 3-digit integer, and therefore should not be returned fromgetStatus
.Though I can't find a reference of a default status code in the Servlet spec, all other
HttpServletResponse
implementations—including previous versions of Jetty—have a default status code of200
.How to reproduce?
This simple Servlet will print the default status code, and prints
0
in Jetty 12, beta 2.The text was updated successfully, but these errors were encountered: