1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:08:10 +00:00

LibWeb: Use is_ascii_case_insensitive_match() where the spec says to

This commit is contained in:
Sam Atkins 2023-02-17 15:21:32 +00:00 committed by Linus Groh
parent f0b72b819e
commit 2026ea557e
10 changed files with 59 additions and 44 deletions

View file

@ -8,6 +8,7 @@
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
#include <LibWeb/Fetch/Infrastructure/NoSniffBlocking.h>
#include <LibWeb/Infra/Strings.h>
namespace Web::Fetch::Infrastructure {
@ -22,7 +23,7 @@ ErrorOr<bool> determine_nosniff(HeaderList const& list)
return false;
// 3. If values[0] is an ASCII case-insensitive match for "nosniff", then return true.
if (!values->is_empty() && values->at(0).equals_ignoring_case("nosniff"sv))
if (!values->is_empty() && Infra::is_ascii_case_insensitive_match(values->at(0), "nosniff"sv))
return true;
// 4. Return false.