Ensure language redirect conditions do not match for too low quality accepted languages

This commit is contained in:
Alejandro Celaya
2024-03-07 10:03:11 +01:00
parent 0bc7412430
commit be8cf56240
5 changed files with 37 additions and 13 deletions

View File

@@ -75,9 +75,15 @@ class RedirectTest extends ApiTestCase
];
yield 'rule: complex matching accept language' => [
[
RequestOptions::HEADERS => ['Accept-Language' => 'fr-FR, es;q=08, en;q=0.5, *;q=0.2'],
RequestOptions::HEADERS => ['Accept-Language' => 'fr-FR, es;q=0.9, en;q=0.9, *;q=0.2'],
],
'https://example.com/only-english',
];
yield 'rule: too low quality accept language' => [
[
RequestOptions::HEADERS => ['Accept-Language' => 'fr-FR, es;q=0.8, en;q=0.5, *;q=0.2'],
],
'https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/',
];
}
}