mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Store the referrer in the Response and return it in Response::metadata().
This commit is contained in:
parent
a66f186866
commit
28d06ab40a
2 changed files with 6 additions and 1 deletions
|
@ -91,6 +91,7 @@ pub struct Response {
|
|||
pub body: Arc<Mutex<ResponseBody>>,
|
||||
pub cache_state: CacheState,
|
||||
pub https_state: HttpsState,
|
||||
pub referrer: Option<Url>,
|
||||
/// [Internal response](https://fetch.spec.whatwg.org/#concept-internal-response), only used if the Response
|
||||
/// is a filtered response
|
||||
pub internal_response: Option<Box<Response>>,
|
||||
|
@ -111,6 +112,7 @@ impl Response {
|
|||
body: Arc::new(Mutex::new(ResponseBody::Empty)),
|
||||
cache_state: CacheState::None,
|
||||
https_state: HttpsState::None,
|
||||
referrer: None,
|
||||
internal_response: None,
|
||||
return_internal: Cell::new(true)
|
||||
}
|
||||
|
@ -128,6 +130,7 @@ impl Response {
|
|||
body: Arc::new(Mutex::new(ResponseBody::Empty)),
|
||||
cache_state: CacheState::None,
|
||||
https_state: HttpsState::None,
|
||||
referrer: None,
|
||||
internal_response: None,
|
||||
return_internal: Cell::new(true)
|
||||
}
|
||||
|
@ -244,6 +247,7 @@ impl Response {
|
|||
metadata.headers = Some(Serde(response.headers.clone()));
|
||||
metadata.status = response.raw_status.clone();
|
||||
metadata.https_state = response.https_state;
|
||||
metadata.referrer = response.referrer.clone();
|
||||
metadata
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue