]> git.kaiwu.me - njs.git/commit
HTTP: fix missing validation of the r.return() redirect target
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 13 Aug 2026 22:14:42 +0000 (15:14 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 14 Aug 2026 19:56:32 +0000 (12:56 -0700)
commit2ca3f08c79f4ce1ab6248baf0f00a28824950464
treea16cb092a964aa55eb3af50a560cfef70996028b
parentc4df63a33610bc6112e4c723d38d5cd380a924c6
HTTP: fix missing validation of the r.return() redirect target

Previously, for a redirect status ngx_http_send_response() stores the
text passed to r.return() as the Location header value, but the text was
only checked when it was used as a response body, where control
characters are valid.

The text is now validated as a header value for the statuses that turn
it into Location, and is left as is otherwise.
nginx/ngx_http_js_module.c
nginx/t/js.t