mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Dropped root link injection
The only place that the root link is now used is in /skin/index.js, so added it in static/templates/index.html. But it seems that nothing prevents us from from switching from aboslute paths to relative paths in /skin/index.js, which will eliminate the need for the root link altogether. As a result of this change content is never decorated by kiwix serve.
This commit is contained in:
@ -121,7 +121,6 @@ TEST(indexTemplateStringTest, indexTemplateCheck) {
|
||||
"</html>");
|
||||
EXPECT_EQ("<!DOCTYPE html><head>"
|
||||
"<title>Welcome to kiwix library</title>"
|
||||
"<link type=\"root\" href=\"/ROOT\">"
|
||||
"</head>"
|
||||
"</html>", zfs.GET("/ROOT/")->body);
|
||||
}
|
||||
@ -447,7 +446,7 @@ std::string TestContentIn404HtmlResponse::expectedResponse() const
|
||||
)FRAG",
|
||||
|
||||
R"FRAG(
|
||||
<link type="root" href="/ROOT"></head>
|
||||
</head>
|
||||
<body>)FRAG",
|
||||
|
||||
R"FRAG( </body>
|
||||
@ -1028,11 +1027,13 @@ TEST_F(ServerTest, RawEntry)
|
||||
EXPECT_EQ(200, p->status);
|
||||
EXPECT_EQ(std::string(p->body), std::string(entry.getItem(true).getData()));
|
||||
|
||||
/* Now normal content is not decorated in any way, either
|
||||
// ... but the "normal" content is not
|
||||
p = zfs1_->GET("/ROOT/content/zimfile/A/Ray_Charles");
|
||||
EXPECT_EQ(200, p->status);
|
||||
EXPECT_NE(std::string(p->body), std::string(entry.getItem(true).getData()));
|
||||
EXPECT_TRUE(p->body.find("<link type=\"root\" href=\"/ROOT\">") != std::string::npos);
|
||||
*/
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, HeadMethodIsSupported)
|
||||
|
@ -112,7 +112,7 @@ std::string makeSearchResultsHtml(const std::string& pattern,
|
||||
|
||||
</style>
|
||||
<title>Search: %PATTERN%</title>
|
||||
<link type="root" href="/ROOT"></head>
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
<div class="header">
|
||||
%HEADER%
|
||||
|
Reference in New Issue
Block a user