mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Server sets the userlang cookie on every response
This commit is contained in:
committed by
Matthieu Gautier
parent
c0fe6f4aee
commit
1d74b5e311
@ -998,42 +998,41 @@ TEST_F(ServerTest, UserLanguageControl)
|
||||
};
|
||||
|
||||
const char* const NO_COOKIE = nullptr;
|
||||
const char* const NO_SET_COOKIE = nullptr;
|
||||
|
||||
const TestData testData[] = {
|
||||
{
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
||||
/*Accept-Language:*/ "",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=en",
|
||||
/* expected <h1> */ "Not Found"
|
||||
},
|
||||
{
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=en",
|
||||
/*Accept-Language:*/ "",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=en",
|
||||
/* expected <h1> */ "Not Found"
|
||||
},
|
||||
{
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=test",
|
||||
/*Accept-Language:*/ "",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=test",
|
||||
/* expected <h1> */ "[I18N TESTING] Content not found, but at least the server is alive"
|
||||
},
|
||||
{
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
||||
/*Accept-Language:*/ "*",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=en",
|
||||
/* expected <h1> */ "Not Found"
|
||||
},
|
||||
{
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
||||
/*Accept-Language:*/ "test",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=test",
|
||||
/* expected <h1> */ "[I18N TESTING] Content not found, but at least the server is alive"
|
||||
},
|
||||
{
|
||||
@ -1041,7 +1040,7 @@ TEST_F(ServerTest, UserLanguageControl)
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=en",
|
||||
/*Accept-Language:*/ "test",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=en",
|
||||
/* expected <h1> */ "Not Found"
|
||||
},
|
||||
{
|
||||
@ -1051,7 +1050,7 @@ TEST_F(ServerTest, UserLanguageControl)
|
||||
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
||||
/*Accept-Language:*/ "test;q=0.9, en;q=0.2",
|
||||
/*Request Cookie:*/ NO_COOKIE,
|
||||
/*Response Set-Cookie:*/ NO_SET_COOKIE,
|
||||
/*Response Set-Cookie:*/ "userlang=en",
|
||||
/* expected <h1> */ "Not Found"
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user