Closed anqit closed 1 month ago
/bounty $75 to only form proper warning headers (note that warning headers will probably be removed shortly).
/attempt #2948
with your implementation plan/claim #2948
in the PR body to claim the bountyThank you for contributing to zio/zio-http!
Add a bounty β’ Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
π‘ @uurl | Aug 19, 2024, 2:59:11 AM | WIP |
π’ @987Nabil | #3050 |
/attempt #2948
@uurl: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then π
ππ @987Nabil has been awarded $75! ππ
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.