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

Change of behaviour with HttpServletResponse.sendError(0) in EE10 #12609

Open
lachlan-roberts opened this issue Dec 4, 2024 · 1 comment
Open
Labels
Bug For general bugs on Jetty side

Comments

@lachlan-roberts
Copy link
Contributor

Jetty version(s)
12.0.x

Jetty Environment
ee10

Description
I noticed that resp.sendError(0) has a change of behaviour in EE10 compared to EE8 and Jetty 9.4

Previously Jetty would throw IAE for status 0.
Now this will send back a 200 response with no body.

java.lang.IllegalArgumentException
        at org.eclipse.jetty.ee8.nested.Response.setStatus(Response.java:666)
        at org.eclipse.jetty.ee8.nested.HttpChannelState.sendError(HttpChannelState.java:782)
        at org.eclipse.jetty.ee8.nested.Response.sendError(Response.java:449)
        at org.eclipse.jetty.ee8.nested.Response.sendError(Response.java:422)
        at org.example.DemoServlet.service(DemoServlet.java:16)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
        at org.eclipse.jetty.ee8.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1146)
        at org.eclipse.jetty.ee8.servlet.ServletHolder.handle(ServletHolder.java:640)
@lachlan-roberts lachlan-roberts added the Bug For general bugs on Jetty side label Dec 4, 2024
@gregw
Copy link
Contributor

gregw commented Dec 4, 2024

We should probably validate that the status is 100-599 or one of the known exceptional codes (-1 for abort).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

2 participants