summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Mansell <joosters@php.net>2001-03-22 18:48:51 +0000
committerBen Mansell <joosters@php.net>2001-03-22 18:48:51 +0000
commit87bc51fc5c831e527f954d5ff576c3c17e1c435e (patch)
treeb3494a26166354f7c16da585a91c224b6df1934c
parent49bc33395baad7458f61c2575ff4ccebe0cce737 (diff)
downloadphp-git-87bc51fc5c831e527f954d5ff576c3c17e1c435e.tar.gz
Fix a bug with POST requests. If the Content-Type header wasn't present,
we were setting SG(request_info).content_type to NULL, instead of an empty string. This was stopping PHP from processing the data.
-rw-r--r--sapi/fastcgi/fastcgi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c
index 8db43ae792..abc298553d 100644
--- a/sapi/fastcgi/fastcgi.c
+++ b/sapi/fastcgi/fastcgi.c
@@ -218,6 +218,7 @@ static void fastcgi_module_main(TLS_D SLS_DC)
static void init_request_info( SLS_D )
{
char *content_length = getenv("CONTENT_LENGTH");
+ char *content_type = getenv( "CONTENT_TYPE" );
const char *auth;
struct stat st;
char *pi = getenv( "PATH_INFO" );
@@ -227,7 +228,7 @@ static void init_request_info( SLS_D )
SG(request_info).request_method = getenv("REQUEST_METHOD");
SG(request_info).query_string = getenv("QUERY_STRING");
SG(request_info).request_uri = path_info;
- SG(request_info).content_type = getenv("CONTENT_TYPE");
+ SG(request_info).content_type = ( content_type ? content_type : "" );
SG(request_info).content_length = (content_length?atoi(content_length):0);
SG(sapi_headers).http_response_code = 200;