mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix the redirected attribute for Response
This commit is contained in:
parent
566147dab3
commit
aa43ce8cf3
5 changed files with 11 additions and 66 deletions
|
@ -638,6 +638,8 @@ pub struct Metadata {
|
|||
pub referrer_policy: Option<ReferrerPolicy>,
|
||||
/// Performance information for navigation events
|
||||
pub timing: Option<ResourceFetchTiming>,
|
||||
/// True if the request comes from a redirection
|
||||
pub redirected: bool,
|
||||
}
|
||||
|
||||
impl Metadata {
|
||||
|
@ -655,6 +657,7 @@ impl Metadata {
|
|||
referrer: None,
|
||||
referrer_policy: None,
|
||||
timing: None,
|
||||
redirected: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -310,6 +310,7 @@ impl Response {
|
|||
metadata.https_state = response.https_state;
|
||||
metadata.referrer = response.referrer.clone();
|
||||
metadata.referrer_policy = response.referrer_policy.clone();
|
||||
metadata.redirected = response.actual_response().url_list.len() > 1;
|
||||
metadata
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue