mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
added code for status code 204 for empty return of search.
This commit is contained in:
committed by
manan jethwani
parent
1884081ebe
commit
599aaa4c1b
@ -155,7 +155,7 @@ const ResourceCollection resources200Compressible{
|
||||
{ NO_ETAG, "/catalog/searchdescription.xml" },
|
||||
{ NO_ETAG, "/catalog/search" },
|
||||
|
||||
{ NO_ETAG, "/search?content=zimfile&pattern=abcd" },
|
||||
{ NO_ETAG, "/search?content=zimfile&pattern=a" },
|
||||
|
||||
{ NO_ETAG, "/suggest?content=zimfile&term=ray" },
|
||||
|
||||
@ -197,6 +197,15 @@ TEST_F(ServerTest, 200)
|
||||
EXPECT_EQ(200, zfs1_->GET(res.url)->status) << "res.url: " << res.url;
|
||||
}
|
||||
|
||||
// seperate test for 204 code
|
||||
|
||||
TEST_F(ServerTest, EmptySearchReturnsA204StatusCode)
|
||||
{
|
||||
const char* url="/search?content=zimfile&pattern=abcd";
|
||||
auto res=zfs1_->GET(url);
|
||||
EXPECT_EQ(204, res->status) << "res.url: " << url;
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, CompressibleContentIsCompressedIfAcceptable)
|
||||
{
|
||||
for ( const Resource& res : resources200Compressible ) {
|
||||
|
Reference in New Issue
Block a user