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

Allow no response headers #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LevitatingBusinessMan
Copy link

Currently it isn't possible for a script to not set any response headers.

Fcgiwrap already some work to allow the omission of carriage returns, I slightly altered the statemachine responsible for this to allow for responses with no response headers.

Although response headers are technically required according to rfc3875 it is sometimes omitted.

For instance mod_cgi of lighthttpd will work with just the body:
https://github.com/lighttpd/lighttpd1.4/blob/master/src/mod_cgi.c#L631-L639

With this PR a response can now start with a linefeed and then begin it's body.

Additionally I marked cgi_error __noreturn__ as a fix for #57.

fixes #57

@gstrauss
Copy link

Although response headers are technically required according to rfc3875 it is sometimes omitted.

FYI: when that occurs, it is frequently someone new to CGI who is unaware of how to write a CGI or FastCGI script.

Providing Status: 200\n\n is sufficient for a 200 OK response, and sending Status is recommended when the body might be empty (where you might send Status: 204\n\n)

If fcgiwrap has long not supported omitting the response header, then there is no backwards compatibility needed and fcgiwrap should continue to reject invalid responses. The reason I added the referenced code to lighttpd mod_cgi to support the case of missing response header was for backwards compatibility.

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 this pull request may close these issues.

fcgiwrap.c:555:4: error: this statement may fall through
2 participants