mirror of https://github.com/kiwix/libkiwix.git
Fixed OPDS XML output for multiple filters
In XML any & symbols acting as parameter separators in URL search components must be HTML-escaped.
This commit is contained in:
parent
4f6a5759aa
commit
ebe16f92a5
|
@ -6,7 +6,7 @@
|
||||||
<id>{{feed_id}}</id>
|
<id>{{feed_id}}</id>
|
||||||
|
|
||||||
<link rel="self"
|
<link rel="self"
|
||||||
href="{{endpoint_root}}/{{#dump_partial_entries}}partial_{{/dump_partial_entries}}entries{{{query}}}"
|
href="{{endpoint_root}}/{{#dump_partial_entries}}partial_{{/dump_partial_entries}}entries{{query}}"
|
||||||
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
||||||
<link rel="start"
|
<link rel="start"
|
||||||
href="{{endpoint_root}}/root.xml"
|
href="{{endpoint_root}}/root.xml"
|
||||||
|
|
|
@ -728,7 +728,7 @@ TEST_F(LibraryServerTest, catalog_v2_entries_filtered_by_range)
|
||||||
const auto r = zfs1_->GET("/ROOT%23%3F/catalog/v2/entries?start=1&count=1");
|
const auto r = zfs1_->GET("/ROOT%23%3F/catalog/v2/entries?start=1&count=1");
|
||||||
EXPECT_EQ(r->status, 200);
|
EXPECT_EQ(r->status, 200);
|
||||||
EXPECT_EQ(maskVariableOPDSFeedData(r->body),
|
EXPECT_EQ(maskVariableOPDSFeedData(r->body),
|
||||||
CATALOG_V2_ENTRIES_PREAMBLE("?start=1&count=1")
|
CATALOG_V2_ENTRIES_PREAMBLE("?start=1&count=1")
|
||||||
" <title>Filtered Entries (start=1&count=1)</title>\n"
|
" <title>Filtered Entries (start=1&count=1)</title>\n"
|
||||||
" <updated>YYYY-MM-DDThh:mm:ssZ</updated>\n"
|
" <updated>YYYY-MM-DDThh:mm:ssZ</updated>\n"
|
||||||
" <totalResults>3</totalResults>\n"
|
" <totalResults>3</totalResults>\n"
|
||||||
|
@ -799,7 +799,7 @@ TEST_F(LibraryServerTest, catalog_v2_entries_multiple_filters)
|
||||||
const auto r = zfs1_->GET("/ROOT%23%3F/catalog/v2/entries?lang=fra&category=jazz");
|
const auto r = zfs1_->GET("/ROOT%23%3F/catalog/v2/entries?lang=fra&category=jazz");
|
||||||
EXPECT_EQ(r->status, 200);
|
EXPECT_EQ(r->status, 200);
|
||||||
EXPECT_EQ(maskVariableOPDSFeedData(r->body),
|
EXPECT_EQ(maskVariableOPDSFeedData(r->body),
|
||||||
CATALOG_V2_ENTRIES_PREAMBLE("?lang=fra&category=jazz")
|
CATALOG_V2_ENTRIES_PREAMBLE("?lang=fra&category=jazz")
|
||||||
" <title>Filtered Entries (lang=fra&category=jazz)</title>\n"
|
" <title>Filtered Entries (lang=fra&category=jazz)</title>\n"
|
||||||
" <updated>YYYY-MM-DDThh:mm:ssZ</updated>\n"
|
" <updated>YYYY-MM-DDThh:mm:ssZ</updated>\n"
|
||||||
" <totalResults>1</totalResults>\n"
|
" <totalResults>1</totalResults>\n"
|
||||||
|
|
Loading…
Reference in New Issue