]> git.kaiwu.me - nginx.git/commitdiff
Perl: avoid redirects on errors.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 12 Jul 2019 12:38:27 +0000 (15:38 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 12 Jul 2019 12:38:27 +0000 (15:38 +0300)
Previously, redirects scheduled with $r->internal_redirect() were followed
even if the code then died.  Now these are ignored and nginx will return
an error instead.

src/http/modules/perl/ngx_http_perl_module.c

index a383e9002ee7a02a38eebc65c9e0339622e20247..81b2526add575e84a8be4680afd1e4ea2a5c519a 100644 (file)
@@ -778,6 +778,8 @@ ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r,
             return NGX_ERROR;
         }
 
+        ctx->redirect_uri.len = 0;
+
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }