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

POST requests not working in FastCGI - with potential fix #50

Open
brendonm opened this issue Jun 25, 2015 · 2 comments
Open

POST requests not working in FastCGI - with potential fix #50

brendonm opened this issue Jun 25, 2015 · 2 comments

Comments

@brendonm
Copy link

When a POST request is sent to httpd, none of the Content-X headers are being sent through FastCGI, and I'm not sure that the content itself is sent either. This effectively eliminates the possibility of using form submissions, which are a very important part of any web application.

@brendonm
Copy link
Author

To clarify, the Content-Type and Content-Length headers are being sent through FastCGI as CONTENT_TYPE and CONTENT_LENGTH respectively. This differs from the nginx implementation which also includes them as HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH.

It is preferable from an application point of view to have these headers come through with HTTP_ prefix, as they can then use this prefix to show all the headers sent from the client without having to apply additional logic.

@brendonm
Copy link
Author

Possible fix could be to comment out the following lines:

httpd/server_fcgi.c: 649

// if (strcasecmp(key, "Content-Length") == 0 ||
// strcasecmp(key, "Content-Type") == 0) {
// if ((name = strdup(key)) == NULL)
// return (-1);
// } else {
if (asprintf(&name, "HTTP_%s", key) == -1)
return (-1);
// }

@brendonm brendonm changed the title POST requests not working in FastCGI POST requests not working in FastCGI - with potential fix Jun 30, 2015
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

No branches or pull requests

1 participant