diff options
author | Ben Mansell <joosters@php.net> | 2001-03-22 18:54:51 +0000 |
---|---|---|
committer | Ben Mansell <joosters@php.net> | 2001-03-22 18:54:51 +0000 |
commit | 4549e389bb9309617e69339d0da85523bcd451f4 (patch) | |
tree | c04ee86a5a309a79366c23fec3cac4616e9b889a /sapi/cgi/cgi_main.c | |
parent | 87bc51fc5c831e527f954d5ff576c3c17e1c435e (diff) | |
download | php-git-4549e389bb9309617e69339d0da85523bcd451f4.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.
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r-- | sapi/cgi/cgi_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 4f9ff00e8f..8b9780dd96 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -263,6 +263,7 @@ static void php_cgi_usage(char *argv0) static void init_request_info(SLS_D) { char *content_length = getenv("CONTENT_LENGTH"); + char *content_type = getenv("CONTENT_TYPE"); const char *auth; #if 0 @@ -311,7 +312,7 @@ static void init_request_info(SLS_D) SG(request_info).request_uri = getenv("SCRIPT_NAME"); } SG(request_info).path_translated = NULL; /* we have to update it later, when we have that information */ - 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; |