mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Testing of redirection to URLs with special symbols
This commit is contained in:
Binary file not shown.
1
test/data/corner_cases/wtf.html
Symbolic link
1
test/data/corner_cases/wtf.html
Symbolic link
@ -0,0 +1 @@
|
||||
wtf?.html
|
1
test/data/corner_cases/wtf?
Symbolic link
1
test/data/corner_cases/wtf?
Symbolic link
@ -0,0 +1 @@
|
||||
wtf?.html
|
11
test/data/corner_cases/wtf?.html
Normal file
11
test/data/corner_cases/wtf?.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>WTF?</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>WTF? is an acronym coined by cryptography and security researcher Walter
|
||||
Thomas Freiwald. It stands for "Will They Factorize?"</p>
|
||||
</body>
|
||||
</html>
|
@ -1196,6 +1196,17 @@ TEST_F(ServerTest, NonEndpointUrlsAreRedirectedToContentUrls)
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, RedirectionsToURLsWithSpecialSymbols)
|
||||
{
|
||||
auto g = zfs1_->GET("/ROOT/content/corner_cases/wtf.html");
|
||||
ASSERT_EQ(302, g->status);
|
||||
ASSERT_TRUE(g->has_header("Location"));
|
||||
ASSERT_EQ(g->get_header_value("Location"), "/ROOT/content/corner_cases/wtf?.html");
|
||||
ASSERT_EQ(getCacheControlHeader(*g), "max-age=0, must-revalidate");
|
||||
ASSERT_FALSE(g->has_header("ETag"));
|
||||
}
|
||||
|
||||
|
||||
TEST_F(ServerTest, BookMainPageIsRedirectedToArticleIndex)
|
||||
{
|
||||
{
|
||||
|
Reference in New Issue
Block a user