Skip to content

Commit

Permalink
Perl: named locations in $r->internal_redirect().
Browse files Browse the repository at this point in the history
  • Loading branch information
mdounin committed Jul 12, 2019
1 parent 8df08b0 commit 29fea7d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/http/modules/perl/ngx_http_perl_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,21 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
}

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

if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
} 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;
}

ngx_http_internal_redirect(r, &uri, &args);
}

ngx_http_internal_redirect(r, &uri, &args);
ngx_http_finalize_request(r, NGX_DONE);
return;
}
Expand Down

0 comments on commit 29fea7d

Please sign in to comment.