Skip to content

Commit bb92233

Browse files
committed
Fix for bug #33057 - Don't send extraneous entity-headers on a 304 as per
RFC 2616 section 10.3.5
1 parent f4a39b5 commit bb92233

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

sapi/apache/mod_php4.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,18 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
209209
*/
210210
static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
211211
{
212-
if(SG(server_context) == NULL) { /* server_context is not here anymore */
212+
request_rec *r = SG(server_context);
213+
214+
if(r == NULL) { /* server_context is not here anymore */
213215
return SAPI_HEADER_SEND_FAILED;
214216
}
215217

216-
((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code;
217-
send_http_header((request_rec *) SG(server_context));
218+
r->status = SG(sapi_headers).http_response_code;
219+
if(r->status==304) {
220+
send_error_response(r,0);
221+
} else {
222+
send_http_header(r);
223+
}
218224
return SAPI_HEADER_SENT_SUCCESSFULLY;
219225
}
220226
/* }}} */

0 commit comments

Comments
 (0)