mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb: Consistently use the EmptyString state of ReferrerPolicy
We previously used an empty optional to denote that a ReferrerPolicy is in the default empty string state. However, later additions added an explicit EmptyString state. This patch moves all users to the explicit state, and stops using `Optional<ReferrerPolicy>` everywhere except for when an option not being passed from JavaScript has meaning.
This commit is contained in:
committed by
Andreas Kling
parent
637f2f2ed6
commit
c79bac70f4
@@ -309,8 +309,8 @@ ErrorOr<void> Request::add_origin_header()
|
||||
// 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
|
||||
else if (!StringView { m_method }.is_one_of("GET"sv, "HEAD"sv)) {
|
||||
// 1. If request’s mode is not "cors", then switch on request’s referrer policy:
|
||||
if (m_mode != Mode::CORS && m_referrer_policy.has_value()) {
|
||||
switch (*m_referrer_policy) {
|
||||
if (m_mode != Mode::CORS) {
|
||||
switch (m_referrer_policy) {
|
||||
// -> "no-referrer"
|
||||
case ReferrerPolicy::ReferrerPolicy::NoReferrer:
|
||||
// Set serializedOrigin to `null`.
|
||||
|
||||
Reference in New Issue
Block a user