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

Improvements and cleanups to ErrorHandler. #11556

Merged
merged 3 commits into from
Mar 24, 2024

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Mar 22, 2024

Defaulted showStacks to false, to reduce false positives reported by penetration testing tools.
Deprecated ErrorHandler.badMessageError(), as it was not invoked anymore.
Implemented HttpStreamOverHTTP[2|3].onBadMessage() that was left as TODO.
Simplified the same code for HTTP/1.
Moved invocation of ComplianceViolation.Listener.onRequestEnd() to HandlerInvoker.completeStream().

Defaulted showStacks to false, to reduce false positives reported by penetration testing tools.
Deprecated ErrorHandler.badMessageError(), as it was not invoked anymore.
Implemented HttpStreamOverHTTP[2|3].onBadMessage() that was left as TODO.
Simplified the same code for HTTP/1.
Moved invocation of ComplianceViolation.Listener.onRequestEnd() to HandlerInvoker.completeStream().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet requested review from gregw and joakime March 22, 2024 14:13
*/
@Deprecated(since = "12.0.8", forRemoval = true)
public ByteBuffer badMessageError(int status, String reason, HttpFields.Mutable fields)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really not called anymore by things like the HttpParser?

Copy link
Contributor Author

@sbordet sbordet Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is not.
In Jetty 11 it was called by HttpChannel, but in Jetty 12 we handle failures differently by always calling HttpChannel.onFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet requested a review from joakime March 22, 2024 15:49
@sbordet sbordet self-assigned this Mar 22, 2024
@gregw
Copy link
Contributor

gregw commented Mar 22, 2024

@sbordet the CI failures are due to the new way we create a request in onFailure

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet
Copy link
Contributor Author

sbordet commented Mar 22, 2024

@gregw yes I'm on it. I decided to restore the creation of the error request in HTTP/1.1 because it has more information.

@sbordet sbordet merged commit 4a22ab3 into jetty-12.0.x Mar 24, 2024
8 checks passed
@sbordet sbordet deleted the fix/jetty-12/improve-error-handler branch March 24, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants