You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If at least one header is written in response and then status code, e.g. 404, then provided status code is ignored and is always 200. Without header, status code is correct.
To Reproduce
Steps to reproduce the behavior:
Start socketify app with following implementation:
from socketify import App
def handler(response, req):
response.write_header(
"Access-Control-Allow-Origin", "*"
)
response.write_status(404)
response.end("Not found")
app = App()
app.any("/*", handler)
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()
Send any request to localhost:3000
Check status code, it is 200 instead of expected 404.
Expected behavior
Status code 404.
Desktop (please complete the following information):
OS: Linux
Additional context
Without response.write_header call, status code is 404 as expected.
The text was updated successfully, but these errors were encountered:
Describe the bug
If at least one header is written in response and then status code, e.g. 404, then provided status code is ignored and is always 200. Without header, status code is correct.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Status code 404.
Desktop (please complete the following information):
Additional context
Without
response.write_header
call, status code is 404 as expected.The text was updated successfully, but these errors were encountered: