Welcome! Log In Create A New Profile

Advanced

[nginx] Perl: named locations in $r->internal_redirect().

Maxim Dounin
July 12, 2019 10:56AM
details: https://hg.nginx.org/nginx/rev/5f642712e7ad
branches:
changeset: 7533:5f642712e7ad
user: Maxim Dounin <mdounin@mdounin.ru>
date: Fri Jul 12 15:39:28 2019 +0300
description:
Perl: named locations in $r->internal_redirect().

diffstat:

src/http/modules/perl/ngx_http_perl_module.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)

diffs (31 lines):

diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -257,15 +257,21 @@ ngx_http_perl_handle_request(ngx_http_re
}

if (uri.len) {
- ngx_str_null(&args);
- flags = NGX_HTTP_LOG_UNSAFE;
+ if (uri.data[0] == '@') {
+ ngx_http_named_location(r, &uri);
+
+ } else {
+ ngx_str_null(&args);
+ flags = NGX_HTTP_LOG_UNSAFE;

- if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
+ if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ return;
+ }
+
+ ngx_http_internal_redirect(r, &uri, &args);
}

- ngx_http_internal_redirect(r, &uri, &args);
ngx_http_finalize_request(r, NGX_DONE);
return;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Perl: named locations in $r->internal_redirect().

Maxim Dounin 232 July 12, 2019 10:56AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 288
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready