-
Notifications
You must be signed in to change notification settings - Fork 128
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
cgi httpd bug when receiving a HEAD request #367
Comments
i'll have to take a look, make sure the Content-Length is set right. Cuz I'm pretty sure HEAD is supposed to set that, but not actually send the content. |
Setting the Content-Length manually with |
it needs to flush the buffers with cgi.write does, but the headers still need to be set as if it was allw ritten i'll get to it later, i gotta fdo soemthing else rn. im p sure the problem is just that the header buffers aren't flushed but they also need to be set right |
see cgi.close calls write(null, false, false) so swapping to true might work if the other headers are right |
Sorry, I got distracted and just tested this now but indeed this very small change does seem to do the job: |
I did a v10.9.10 hotfix released for this and a couple other small issues. |
The bug exists in both
embedded_httpd_threads
andembedded_httpd_process
context : my program is executed on a shared server were http(s) requests are redirected by a Gateway which I have no control on
when using arsd.cgi to receive a request I found that HEAD requests always responded by
502 Bad Gateway
while any other method worked as expected, after investigating I found that the only difference is inCgi.close
where when receiving HEAD, theoutputBuffer
is not written (as expected for HEAD requests)But that writing in close is made with
isAll = true
which seems to be required even for HEAD requestsadding
cgi.write("", true, false)
to my code solved the issueThe text was updated successfully, but these errors were encountered: