mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Make cors_preflight_fetch take a &Request
This commit is contained in:
parent
d5cbdffe37
commit
9601a66b60
1 changed files with 2 additions and 2 deletions
|
@ -542,7 +542,7 @@ pub fn http_fetch(request: Rc<Request>,
|
||||||
|
|
||||||
// Sub-substep 1
|
// Sub-substep 1
|
||||||
if method_mismatch || header_mismatch {
|
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
|
// Sub-substep 2
|
||||||
if let Some(e) = preflight_result.get_network_error() {
|
if let Some(e) = preflight_result.get_network_error() {
|
||||||
return Response::network_error(e.clone());
|
return Response::network_error(e.clone());
|
||||||
|
@ -1204,7 +1204,7 @@ fn http_network_fetch(request: Rc<Request>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch)
|
/// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch)
|
||||||
fn cors_preflight_fetch(request: Rc<Request>,
|
fn cors_preflight_fetch(request: &Request,
|
||||||
cache: &mut CorsCache,
|
cache: &mut CorsCache,
|
||||||
context: &FetchContext)
|
context: &FetchContext)
|
||||||
-> Response {
|
-> Response {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue