Skip to content
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

HTTP header line endings #26

Closed
vojta7 opened this issue Jul 20, 2021 · 2 comments
Closed

HTTP header line endings #26

vojta7 opened this issue Jul 20, 2021 · 2 comments

Comments

@vojta7
Copy link
Contributor

vojta7 commented Jul 20, 2021

Hi,

I recently discovered the merecat is sending an HTTP response in the following format:

HTTP/1.0 200 OK\r\n
Content-type: text/html\n
\n

The status line is correctly ended with '\r\n', but the content-type header and the newline separating headers and body is '\n'. The Unix line endings are produced by my CGI script. I can fix this on the CGI script side, but accord to CGI RFC it seems that CGI servers are supposed to do the translation from native line ends to '\r\n'.

I think that it can be implemented in libhttp.c when interposing cgi_output after the test that headers aren't empty. Would you be willing to add this change? If necessary I can implement it and send PR.

@troglobit
Copy link
Owner

Hi, if you can submit a PR it'll go faster, definitely :)

@troglobit
Copy link
Owner

Fixed in b69d368.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants