mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove referrer policy from document (#34263)
* Remove the referrer policy from document and rely on its policy container Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Make ReferrerPolicy non-optional, instead using a new enum value to represent the empty string case Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Fix clippy issue Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Fix usage of Option<ReferrerPolicy> in unit test Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
parent
83f8e88818
commit
975e2ae859
108 changed files with 171 additions and 1509 deletions
|
@ -336,7 +336,7 @@ pub(crate) fn image_fetch_request(
|
|||
referrer: Referrer,
|
||||
pipeline_id: PipelineId,
|
||||
cors_setting: Option<CorsSettings>,
|
||||
referrer_policy: Option<ReferrerPolicy>,
|
||||
referrer_policy: ReferrerPolicy,
|
||||
from_picture_or_srcset: FromPictureOrSrcSet,
|
||||
) -> RequestBuilder {
|
||||
let mut request =
|
||||
|
@ -1523,12 +1523,13 @@ fn get_correct_referrerpolicy_from_raw_token(token: &DOMString) -> DOMString {
|
|||
// so it should remain unchanged.
|
||||
DOMString::new()
|
||||
} else {
|
||||
match determine_policy_for_token(token) {
|
||||
Some(policy) => DOMString::from_string(policy.to_string()),
|
||||
// If the policy is set to an incorrect value, then it should be
|
||||
// treated as an invalid value default (empty string).
|
||||
None => DOMString::new(),
|
||||
let policy = determine_policy_for_token(token);
|
||||
|
||||
if policy == ReferrerPolicy::EmptyString {
|
||||
return DOMString::new();
|
||||
}
|
||||
|
||||
DOMString::from_string(policy.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue