-
Notifications
You must be signed in to change notification settings - Fork 457
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
contrib/echo: wrap appsec error in echo.HTTPError #1744
Conversation
Can we have a link to the test/job failing because of this maybe ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you caught this before release 👏
It still needs a test to reproduce and confirm the fix please, if you could add it 🙏
Also, I think this simple handler isn't handled properly by you post-handler error management:
func myHandler(ctx echo.Context) error {
return errors.New("my error without any response")
}
where you might end up with the expected behaviour by chance but our monitored HTTP status code will be 0
, while it will actually be 500 if I understood correctly echo's behaviour.
3959404
to
db5ddfb
Compare
db5ddfb
to
66280f4
Compare
What changed:We now call the echo error handlers (
|
What does this PR do?
This change ensures that the error returned by the appsec echo middleware is always an
echo.HTTPError
(or nil).This is needed so that the top level APM code doesn't override the response status span tag with
500
, whichhappens if it encounters any other error type than
echo.HTTPError
Motivation
This fixes a bug spotted while enabling user blocking system-tests.
Reviewer's Checklist
Triage
milestone is set.