-
Notifications
You must be signed in to change notification settings - Fork 386
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
Warning header loses original exception when that exception contains invalid-for-netty-headers characters #2948
Comments
/bounty $75 to only form proper warning headers (note that warning headers will probably be removed shortly). |
💎 $75 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-http! Add a bounty • Share on socials
|
uurl
added a commit
to uurl/zio-http
that referenced
this issue
Aug 19, 2024
/attempt #2948 Options |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I am using zio-http and quill to build a REST service. I create a request handler via
Handler.fromFunctionZIO
that calls into my DB via a quill. In one instance, I forgot tolift
a variable when creating the query (ie I didid == someId
instead ofid == lift(someId)
. This causes quill to throw anIllegalStateException
which is then treated as a fatal defect by the quill-created (I think? I don't think that's a relevant detail) ZIO instance. Withsandbox
turned on for my routes, the error handling mechanism attempts to turn the error into a warning response header. However, the error text for theIllegalStateException
exception has a\n
character in it, which fails netty's header validation (verifyValidHeaderValueCharSequence
inHttpHeaderValidationUtil.java
returns the index of the first\n
in the string and not-1
), causing the original error to be swallowed, and the warning response header to then contain the self-fulfilling meta Schrodinger's errorValidation failed for header 'warning'
.To Reproduce
Steps to reproduce the behaviour:
Server.serve(routes.sandbox)
)Handler.fromFunctionZIO
Expected behaviour
The original error is returned in the warning header.
The text was updated successfully, but these errors were encountered: