Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2023-03-31 17:27:07 +02:00
commit 3d1d593438
No known key found for this signature in database
GPG Key ID: 1677D141BCF3584D
1 changed files with 9 additions and 0 deletions

View File

@ -89,4 +89,13 @@ public class RedirectRegexRuleTest extends AbstractRuleTestCase
rule.matchAndApply("/api/rest/foo?id=100&sort=date", _request, _response); rule.matchAndApply("/api/rest/foo?id=100&sort=date", _request, _response);
assertRedirectResponse(HttpStatus.MOVED_PERMANENTLY_301, "http://api.company.com/rest/foo?id=100&sort=date"); assertRedirectResponse(HttpStatus.MOVED_PERMANENTLY_301, "http://api.company.com/rest/foo?id=100&sort=date");
} }
@Test
public void testEncodedNewLineInURI() throws Exception
{
RedirectRegexRule rule = new RedirectRegexRule("(.+)$", "https://example$1");
rule.matchAndApply("/%0A.evil.com", _request, _response);
assertRedirectResponse(HttpStatus.FOUND_302, "https://example/%0A.evil.com");
}
} }