OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/loader/resource/ScriptResourceData.h" |
| 6 |
| 7 #include "platform/HTTPNames.h" |
| 8 #include "platform/loader/fetch/CrossOriginAccessControl.h" |
| 9 #include "platform/network/mime/MIMETypeRegistry.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 // static |
| 14 bool ScriptResourceData::MimeTypeAllowedByNosniff( |
| 15 const ResourceResponse& response) { |
| 16 return ParseContentTypeOptionsHeader( |
| 17 response.HttpHeaderField(HTTPNames::X_Content_Type_Options)) != |
| 18 kContentTypeOptionsNosniff || |
| 19 MIMETypeRegistry::IsSupportedJavaScriptMIMEType( |
| 20 response.HttpContentType()); |
| 21 } |
| 22 |
| 23 AccessControlStatus ScriptResourceData::CalculateAccessControlStatus() const { |
| 24 if (cors_status_ == CORSStatus::kServiceWorkerOpaque) |
| 25 return kOpaqueResource; |
| 26 |
| 27 // FOXME |
| 28 // if (IsSameOriginOrCORSSuccessful()) |
| 29 // return kSharableCrossOrigin; |
| 30 |
| 31 return kNotSharableCrossOrigin; |
| 32 } |
| 33 |
| 34 } // namespace blink |
OLD | NEW |