]> git.kaiwu.me - nginx.git/commitdiff
fix r2590: error_page made an external redirect without query string
authorIgor Sysoev <igor@sysoev.ru>
Tue, 7 Apr 2009 15:50:08 +0000 (15:50 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 7 Apr 2009 15:50:08 +0000 (15:50 +0000)
src/http/ngx_http_core_module.c
src/http/ngx_http_special_response.c

index ffdd0b044cd4f5be83c75f48692f13571824cf91..b6f4b11e1bbbf606ed6d3a56ea226305e6d38284 100644 (file)
@@ -3875,7 +3875,7 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     args.len = 0;
     args.data = NULL;
 
-    if (cv.lengths == NULL) {
+    if (cv.lengths == NULL && uri.data[0] == '/') {
         p = (u_char *) ngx_strchr(uri.data, '?');
 
         if (p) {
index 38d0d393caefe7aead3802f49a3c445baa4ea3f9..f50f1056ebcbdf6ec7c03e7ef21ae9ca7b5a9e06 100644 (file)
@@ -451,14 +451,14 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
         return NGX_ERROR;
     }
 
-    if (err_page->value.lengths) {
-        ngx_http_split_args(r, &uri, &args);
+    if (uri.data[0] == '/') {
 
-    } else {
-        args = err_page->args;
-    }
+        if (err_page->value.lengths) {
+            ngx_http_split_args(r, &uri, &args);
 
-    if (uri.data[0] == '/') {
+        } else {
+            args = err_page->args;
+        }
 
         if (r->method != NGX_HTTP_HEAD) {
             r->method = NGX_HTTP_GET;