Skip to content

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