mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Cleanup Window, XHR
This commit is contained in:
parent
ac1b7a3896
commit
5c4f91c0f1
3 changed files with 15 additions and 17 deletions
|
@ -784,19 +784,17 @@ impl<'a> PrivateXMLHttpRequestHelpers for &'a XMLHttpRequest {
|
|||
|
||||
fn process_headers_available(self, cors_request: Option<CORSRequest>,
|
||||
gen_id: GenerationId, metadata: Metadata) -> Result<(), Error> {
|
||||
match cors_request {
|
||||
Some(ref req) => {
|
||||
match metadata.headers {
|
||||
Some(ref h) if allow_cross_origin_request(req, h) => {},
|
||||
_ => {
|
||||
self.process_partial_response(XHRProgress::Errored(gen_id, Network));
|
||||
return Err(Network);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_ => {}
|
||||
};
|
||||
if let Some(ref req) = cors_request {
|
||||
match metadata.headers {
|
||||
Some(ref h) if allow_cross_origin_request(req, h) => {},
|
||||
_ => {
|
||||
self.process_partial_response(XHRProgress::Errored(gen_id, Network));
|
||||
return Err(Network);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// XXXManishearth Clear cache entries in case of a network error
|
||||
self.process_partial_response(XHRProgress::HeadersReceived(gen_id,
|
||||
metadata.headers,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue