LibWeb: Simplify String to CORSSettingAttribute value conversion

There's no need to check the "anonymous" case explicitly, as
`CORSSettingAttribute::Anonymous` is the default value.
This commit is contained in:
Tim Ledbetter 2024-03-21 18:34:01 +00:00 committed by Andreas Kling
parent aabf1a65b1
commit 7b08fd9f72
Notes: sideshowbarker 2024-07-17 07:43:44 +09:00

View file

@ -15,9 +15,6 @@ CORSSettingAttribute cors_setting_attribute_from_keyword(Optional<String> const&
// its missing value default is the No CORS state
return CORSSettingAttribute::NoCORS;
}
if (keyword->is_empty() || keyword->bytes_as_string_view().equals_ignoring_ascii_case("anonymous"sv)) {
return CORSSettingAttribute::Anonymous;
}
if (keyword->bytes_as_string_view().equals_ignoring_ascii_case("use-credentials"sv)) {
return CORSSettingAttribute::UseCredentials;
}