You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Status-Code element is a 3-digit integer result code
0 is not a 3-digit integer, and therefore should not be returned from getStatus.
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 of 200.
How to reproduce?
This simple Servlet will print the default status code, and prints 0 in Jetty 12, beta 2.
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.
However, we can change the servlet APIs to always return 200, as they did in previous releases
Note that 0 means not set and the default when not set is 200, so 200 will be sent.
However, I will update the servlet API classes to represent 0 as 200 as they don't care about not-set
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: