| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 DCHECK(requestURL.user().isEmpty()); | 93 DCHECK(requestURL.user().isEmpty()); |
| 94 DCHECK(requestURL.pass().isEmpty()); | 94 DCHECK(requestURL.pass().isEmpty()); |
| 95 | 95 |
| 96 ResourceRequest preflightRequest(requestURL); | 96 ResourceRequest preflightRequest(requestURL); |
| 97 preflightRequest.setAllowStoredCredentials(false); | 97 preflightRequest.setAllowStoredCredentials(false); |
| 98 preflightRequest.setHTTPMethod(HTTPNames::OPTIONS); | 98 preflightRequest.setHTTPMethod(HTTPNames::OPTIONS); |
| 99 preflightRequest.setHTTPHeaderField(HTTPNames::Access_Control_Request_Method, | 99 preflightRequest.setHTTPHeaderField(HTTPNames::Access_Control_Request_Method, |
| 100 AtomicString(request.httpMethod())); | 100 AtomicString(request.httpMethod())); |
| 101 preflightRequest.setPriority(request.priority()); | 101 preflightRequest.setPriority(request.priority()); |
| 102 preflightRequest.setRequestContext(request.requestContext()); | 102 preflightRequest.setRequestContext(request.requestContext()); |
| 103 preflightRequest.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::All); | 103 preflightRequest.setServiceWorkerMode(WebURLRequest::ServiceWorkerMode::None); |
| 104 | 104 |
| 105 if (request.isExternalRequest()) { | 105 if (request.isExternalRequest()) { |
| 106 preflightRequest.setHTTPHeaderField( | 106 preflightRequest.setHTTPHeaderField( |
| 107 HTTPNames::Access_Control_Request_External, "true"); | 107 HTTPNames::Access_Control_Request_External, "true"); |
| 108 } | 108 } |
| 109 | 109 |
| 110 AtomicString requestHeaders = | 110 AtomicString requestHeaders = |
| 111 createAccessControlRequestHeadersHeader(request.httpHeaderFields()); | 111 createAccessControlRequestHeadersHeader(request.httpHeaderFields()); |
| 112 if (requestHeaders != nullAtom) { | 112 if (requestHeaders != nullAtom) { |
| 113 preflightRequest.setHTTPHeaderField( | 113 preflightRequest.setHTTPHeaderField( |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 // | 532 // |
| 533 // This is equivalent to the step 2 in | 533 // This is equivalent to the step 2 in |
| 534 // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch | 534 // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch |
| 535 if (options.credentialsRequested == ClientDidNotRequestCredentials) | 535 if (options.credentialsRequested == ClientDidNotRequestCredentials) |
| 536 options.allowCredentials = DoNotAllowStoredCredentials; | 536 options.allowCredentials = DoNotAllowStoredCredentials; |
| 537 } | 537 } |
| 538 return true; | 538 return true; |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace blink | 541 } // namespace blink |
| OLD | NEW |