fix r2590: error_page made an external redirect without query string

This commit is contained in:
Igor Sysoev 2009-04-07 15:50:08 +00:00
parent 74732dded2
commit 64851bb2ae
2 changed files with 8 additions and 8 deletions

View 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) {

View File

@ -451,15 +451,15 @@ 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);
} else {
args = err_page->args;
}
if (uri.data[0] == '/') {
if (err_page->value.lengths) {
ngx_http_split_args(r, &uri, &args);
} else {
args = err_page->args;
}
if (r->method != NGX_HTTP_HEAD) {
r->method = NGX_HTTP_GET;
r->method_name = ngx_http_get_name;