Re: Apache 2 & incorrect 304 response to "If-Modified-Since"
| From: | Yasuo Ohgaki | Date: | Tue, 15 Oct 2002 00:46:30 +0000 |
| Subject: | Re: Apache 2 & incorrect 304 response to "If-Modified-Since" | ||
| References: | 1 | Groups: | php.dev php.install |
| Request: | Send a blank email to php-dev+get-89462@lists.php.net to get a copy of this message | ||
Takagi Ryo wrote:
Hi, I've been trying to set up PHP 4.2.3 that works with Apache 2.0.43 running on Red Hat Linux 6.2 server, but could not find a way to let it reply correctly to requests with If-Modified-Since: header other than to modify PHP source code.Try CVS version.
Below is the patch I am using now, which is "borrowed" from the Apache mod_include.c source code. Would someone please comment on this .. Is this opening up, for example, a security hole?Wrong list for asking comment for a patch. I posted php.dev also.
I could not test 4.3.0-pre1 thoroughly because it did not work when I used it with multibyte character contents, but the header issue seems to be the same.Hmm... Let us know the problem so that we can fix problems before release. -- Yasuo Ohgaki
Thanks in advance, Ryo --- sapi/apache2filter/sapi_apache2.c~ Fri Aug 16 07:27:03 2002 +++ sapi/apache2filter/sapi_apache2.c Mon Oct 14 23:27:26 2002 @@ -558,14 +558,24 @@return OK;} +static int includes_setup(ap_filter_t *f) +{+ /* We will ALWAYS set the no_local_copy value to 1 so + * that we will not send 304s. + */ + f->r->no_local_copy = 1;++ return OK;+} + static void php_register_hook(apr_pool_t *p) {ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_insert_filter(php_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_read_request(php_post_read_request, NULL, NULL, APR_HOOK_MIDDLE); - ap_register_output_filter("PHP", php_output_filter, NULL, AP_FTYPE_RESOURCE); - ap_register_input_filter("PHP", php_input_filter, NULL, AP_FTYPE_RESOURCE); + ap_register_output_filter("PHP", php_output_filter, includes_setup, AP_FTYPE_RESOURCE); + ap_register_input_filter("PHP", php_input_filter, includes_setup, AP_FTYPE_RESOURCE);} AP_MODULE_DECLARE_DATA module php4_module = {