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

Generic support for 1xx responses and early hints in particular #542

Open
markt-asf opened this issue Sep 26, 2023 · 3 comments
Open

Generic support for 1xx responses and early hints in particular #542

markt-asf opened this issue Sep 26, 2023 · 3 comments

Comments

@markt-asf
Copy link
Contributor

This issue arose from discussions around dropping HTTP/2 push support in #538.

Do we reuse sendError(), introduce a new method or something else?

Given the Javadoc for sendError(), I think a new method (name?) would be better.

Given the number of different methods that can set status codes, I think we should also add a requirement to throw IllegalArgumentException if any such method is used with an inappropriate status code (e.g. a 4xx code with sendRedirect)

@gregw
Copy link
Contributor

gregw commented Sep 26, 2023

Note that eclipse jetty has had a proprietary extension to sendError for some time to support 102 Processing and now 103 Early Hints. We also treat -1 specially as a request to abort/reset the response. This is useful for trying to communicate failure when an error has been detected, but the response is already committed.

I think a sendInformationalStatus(int) method would be fine... although we probably would need to block 101, as that has other implications beyond what can be done in a servlet. Perhaps an abort() method to cover the -1 case above?

@markt-asf
Copy link
Contributor Author

By abort() do you mean close the connection?

@markt-asf
Copy link
Contributor Author

Support for early hints was added via #672

The discussion around #672 concluded generic 1xx support was not viable.

Leaving this issue open for the abort() method and the use of inappropriate codes with methods like sendRedirect().

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

No branches or pull requests

2 participants