Req #67013 [Wfx]: make default status code configurable

From: Date: Fri, 04 Apr 2014 05:33:53 +0000
Subject: Req #67013 [Wfx]: make default status code configurable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185081@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67013&edit=1 ID: 67013 User updated by: chibisuke at web dot de Reported by: chibisuke at web dot de Summary: make default status code configurable Status: Wont fix Type: Feature/Change Request Package: *Web Server problem Operating System: all PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The fact that one has to explicitly write code to support this is the reason I'm suggesting this change. If the code doesn't support it PHP should report this as "unsupported" (HTTP/405). Previous Comments: ------------------------------------------------------------------------ [2014-04-03 21:18:34] requinix@php.net You're free to go through the RFC process to propose this feature, but the basic response is No thanks. For one, adding INI settings is strongly discouraged. One of the biggest reasons is the problem of portability: now code has to be aware of multiple possible configurations of an environment. It also adds more risk to installing and upgrading PHP as it's easy for settings to be missed; I, for one, frequently deal with people asking about why their application changed when their host upgraded PHP versions. More significantly, this is totally something that should be addressed by a userland framework. Stock PHP does not do proxying or WebDAV or anything more complex than parsing request bodies and handling file uploads. Given that one already has to write code to support these other features, it's trivial to simply add a call to header() in an appropriate place. ------------------------------------------------------------------------ [2014-04-03 19:24:16] chibisuke at web dot de Description: ------------ Currently PHP sends a HTTP/200 Success Status code to the browser if it recived a CONNECT request. Game goes for webdav requests like PROPFIND, DELETE ect. Most scripts are not ment to handle this kind of requests, so it would make sense to allow modifying the default status code of such requests. For example in case of a CONNECT replying HTTP/200 is plain simply wrong unless in verify specific cases where PHP actually is proxying stuff. So I suggest to create ini directive which HTTP Status codes to reply by default. Any change by a user script can then happen using the header() function. as defaults I'd suggest to use HTTP/405 for CONNECT, anything else should return HTTP/200 for now. This default should later be changed to HTTP/405 for anything beside GET and POST once ppl had time to ajust their scripts. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67013&edit=1

« previous php.bugs (#185081) next »