From aef36ce828ea1a1a6b12c5d93b071c38f008ec61 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 1 Jan 2023 17:41:08 +0100 Subject: [PATCH] LibWeb: Add ReferrerPolicy::EmptyString One of the valid enum values for "referrer policy" is the empty string. Since we're using an enum for this, just add it as an enum value. --- Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.cpp | 2 ++ Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.h | 1 + 2 files changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.cpp b/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.cpp index 51309409c59..c87dc0b929a 100644 --- a/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.cpp +++ b/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.cpp @@ -11,6 +11,8 @@ namespace Web::ReferrerPolicy { StringView to_string(ReferrerPolicy referrer_policy) { switch (referrer_policy) { + case ReferrerPolicy::EmptyString: + return ""sv; case ReferrerPolicy::NoReferrer: return "no-referrer"sv; case ReferrerPolicy::NoReferrerWhenDowngrade: diff --git a/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.h b/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.h index 6679272e3d7..577463aca58 100644 --- a/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.h +++ b/Userland/Libraries/LibWeb/ReferrerPolicy/ReferrerPolicy.h @@ -13,6 +13,7 @@ namespace Web::ReferrerPolicy { // https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy enum class ReferrerPolicy { + EmptyString, NoReferrer, NoReferrerWhenDowngrade, SameOrigin,