From 3c0411c496e1b70dd09b094301a4f4a39d8fecab Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Mon, 14 Mar 2005 19:25:39 +0000 Subject: Fix for bug #32263 This adds proto_num to request_info. It is defaulted to HTTP 1.0 (1000) such that it has a valid value even if the underlying sapi doesn't set it correctly. It is then used to determine if a 302 or a 303 should be sent on a Location redirect. Any non GET/HEAD HTTP 1.1 redirect will get a 303 instead of a 302 to be compatible with the HTTP spec. --- sapi/tux/php_tux.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sapi/tux/php_tux.c') diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index e7cbf217cd..d227b65172 100644 --- a/sapi/tux/php_tux.c +++ b/sapi/tux/php_tux.c @@ -336,6 +336,8 @@ static void tux_request_ctor(TSRMLS_D) smart_str_0(&s); SG(request_info).request_uri = s.c; SG(request_info).request_method = CGI_REQUEST_METHOD(TG(req)); + if(TG(req)->http_version == HTTP_1_1) SG(request_info).proto_num = 1001; + else SG(request_info).proto_num = 1000; SG(sapi_headers).http_response_code = 200; SG(request_info).content_type = TG(req)->content_type; SG(request_info).content_length = 0; /* TG(req)->contentlength; */ -- cgit v1.2.1