Bug #66606 [Csd]: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE

From: Date: Sun, 09 Aug 2015 01:02:51 +0000
Subject: Bug #66606 [Csd]: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195042@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66606&edit=1 ID: 66606 Updated by: cmb@php.net Reported by: pmjones88 at gmail dot com Summary: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE Status: Closed Type: Bug Package: Built-in web server Operating System: Mac OS X PHP Version: 5.5.8 Assigned To: cmb Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2015-08-09 01:01:24] cmb@php.net Automatic comment on behalf of admin@longchangjin.cn Revision: http://git.php.net/?p=php-src.git;a=commit;h=72976e2497f963b7f203443f9881d52e0ff97962 Log: Fix #66606: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE ------------------------------------------------------------------------ [2015-08-09 00:57:24] cmb@php.net Indeed, RFC 3875 section 4.1.3 states: | If the request includes a message-body, the CONTENT_TYPE | variable is set to the Internet Media Type [6] of the | message-body. | [...] | The server MUST set this meta-variable if an | HTTP Content-Type field is present in the client request header. As there is no particular reason to not to comply with RFC 3875 in this regard, I consider this a bug that ought to be fixed. PR #886 is the way to go. Thanks, wusuopu. ------------------------------------------------------------------------ [2014-01-29 17:40:46] pmjones88 at gmail dot com Description: ------------ The CGI RFC at https://tools.ietf.org/rfc/rfc3875.txt specifies that the Content-Type header value should be stored in CONTENT_TYPE, but the built-in web server stores it in $_SERVER['HTTP_CONTENT_TYPE'] and does not create a $_SERVER['CONTENT_TYPE'] key. (This probably affects CONTENT_LENGTH as well.) Test script: --------------- // put this in an index file and un the PHP web server against it, // then issue curl -H "Content-Type: application/json" http://localhost:8000` // and see that there is no CONTENT_TYPE key, only HTTP_CONTENT_TYPE. var_dump($_SERVER) Expected result: ---------------- Expected to see a CONTENT_TYPE key. Actual result: -------------- Saw only HTTP_CONTENT_TYPE key. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66606&edit=1

« previous php.bugs (#195042) next »