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
You can only set a status on a uWebSockets response once, and you have to set status first, then headers, then a body. To ensure that a status is set before headers are set, the uWebSockets function for setting headers automatically sets the status to 200 first. This means that any subsequent attempt to set a different status will have no effect.
In our server code, there are several places where we first set headers (through AddNoCacheHeaders or otherwise) and then attempt to set a status, which is silently failing. If the status is supposed to be 200 anyway, this makes no difference, but it's impossible for these functions ever to return an error status.
I found this while moving the scripting interface into the HTTP server, but I think that this needs to be fixed and tested in a separate PR -- it's possible that other parts of CARTA are depending on these functions always returning a 200 status, and that something will break once the error codes are restored.
The text was updated successfully, but these errors were encountered:
You can only set a status on a uWebSockets response once, and you have to set status first, then headers, then a body. To ensure that a status is set before headers are set, the uWebSockets function for setting headers automatically sets the status to 200 first. This means that any subsequent attempt to set a different status will have no effect.
In our server code, there are several places where we first set headers (through
AddNoCacheHeaders
or otherwise) and then attempt to set a status, which is silently failing. If the status is supposed to be 200 anyway, this makes no difference, but it's impossible for these functions ever to return an error status.I found this while moving the scripting interface into the HTTP server, but I think that this needs to be fixed and tested in a separate PR -- it's possible that other parts of CARTA are depending on these functions always returning a 200 status, and that something will break once the error codes are restored.
The text was updated successfully, but these errors were encountered: