Bix
Bix copied to clipboard
incorrect status when sleeping in bun http handler
Describe the bug
I have a simple handler that sets the status code to 500 and returns a text body. This works as expected, however when I add a sleep, the body is returned correctly, but the status is 200.
Router.get (
"/status",
(fun next ctx -> promise {
do! Promise.sleep 1000 // <- adding this line causes the status set below to be ignored
return! (setStatusCode 500 >=> sendText "error") next ctx
})
Adapter
- [x] Bix
- [x] Bix.Bun
- [ ] Bix.Deno
- [ ] Bix.Cloudflare
Runtime And Version
- [ ] Node ->
- [x] Bun -> 1.1.8
- [ ] Deno ->
- [ ] Cloudflare ->
Hey there, v1.0.0-beta-006 is on nuget indexing and includes your fix, please let me know if you find something weird there otherwise feel free to close this!
I was able to resolve the new release and it's working. Thank you!