comparison src/http/modules/perl/nginx.xs @ 7532:975d7ab37b39

Perl: expect escaped URIs in $r->internal_redirect(). Similarly to the change in 5491:74bfa803a5aa (1.5.9), we should accept properly escaped URIs and unescape them as needed, else it is not possible to handle URIs with question marks.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 12 Jul 2019 15:39:26 +0300
parents ede052c67512
children 56b4fb46ba7d
comparison
equal deleted inserted replaced
7531:ede052c67512 7532:975d7ab37b39
950 if (ngx_http_perl_sv2str(aTHX_ r, &ctx->redirect_uri, uri) != NGX_OK) { 950 if (ngx_http_perl_sv2str(aTHX_ r, &ctx->redirect_uri, uri) != NGX_OK) {
951 ctx->error = 1; 951 ctx->error = 1;
952 croak("ngx_http_perl_sv2str() failed"); 952 croak("ngx_http_perl_sv2str() failed");
953 } 953 }
954 954
955 for (i = 0; i < ctx->redirect_uri.len; i++) {
956 if (ctx->redirect_uri.data[i] == '?') {
957
958 ctx->redirect_args.len = ctx->redirect_uri.len - (i + 1);
959 ctx->redirect_args.data = &ctx->redirect_uri.data[i + 1];
960 ctx->redirect_uri.len = i;
961
962 XSRETURN_EMPTY;
963 }
964 }
965
966 955
967 void 956 void
968 allow_ranges(r) 957 allow_ranges(r)
969 CODE: 958 CODE:
970 959