From 9601a66b60afea6a1b3261bb2c2ec5ad06b8b425 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 1 Apr 2017 00:17:50 +0200 Subject: [PATCH] Make cors_preflight_fetch take a &Request --- components/net/http_loader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 47eda62a8cb..f00687e9a44 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -542,7 +542,7 @@ pub fn http_fetch(request: Rc, // Sub-substep 1 if method_mismatch || header_mismatch { - let preflight_result = cors_preflight_fetch(request.clone(), cache, context); + let preflight_result = cors_preflight_fetch(&request, cache, context); // Sub-substep 2 if let Some(e) = preflight_result.get_network_error() { return Response::network_error(e.clone()); @@ -1204,7 +1204,7 @@ fn http_network_fetch(request: Rc, } /// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch) -fn cors_preflight_fetch(request: Rc, +fn cors_preflight_fetch(request: &Request, cache: &mut CorsCache, context: &FetchContext) -> Response {