| 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 28 matching lines...) Expand all Loading... |
| 39 bool isOnAccessControlSimpleRequestMethodWhitelist(const String& method) | 39 bool isOnAccessControlSimpleRequestMethodWhitelist(const String& method) |
| 40 { | 40 { |
| 41 return method == "GET" || method == "HEAD" || method == "POST"; | 41 return method == "GET" || method == "HEAD" || method == "POST"; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool isOnAccessControlSimpleRequestHeaderWhitelist(const String& name, const Str
ing& value) | 44 bool isOnAccessControlSimpleRequestHeaderWhitelist(const String& name, const Str
ing& value) |
| 45 { | 45 { |
| 46 if (equalIgnoringCase(name, "accept") | 46 if (equalIgnoringCase(name, "accept") |
| 47 || equalIgnoringCase(name, "accept-language") | 47 || equalIgnoringCase(name, "accept-language") |
| 48 || equalIgnoringCase(name, "content-language") | 48 || equalIgnoringCase(name, "content-language") |
| 49 || equalIgnoringCase(name, "origin")) | 49 || equalIgnoringCase(name, "origin") |
| 50 || equalIgnoringCase(name, "referer")) |
| 50 return true; | 51 return true; |
| 51 | 52 |
| 52 // Preflight is required for MIME types that can not be sent via form submis
sion. | 53 // Preflight is required for MIME types that can not be sent via form submis
sion. |
| 53 if (equalIgnoringCase(name, "content-type")) { | 54 if (equalIgnoringCase(name, "content-type")) { |
| 54 String mimeType = extractMIMETypeFromMediaType(value); | 55 String mimeType = extractMIMETypeFromMediaType(value); |
| 55 return equalIgnoringCase(mimeType, "application/x-www-form-urlencoded") | 56 return equalIgnoringCase(mimeType, "application/x-www-form-urlencoded") |
| 56 || equalIgnoringCase(mimeType, "multipart/form-data") | 57 || equalIgnoringCase(mimeType, "multipart/form-data") |
| 57 || equalIgnoringCase(mimeType, "text/plain"); | 58 || equalIgnoringCase(mimeType, "text/plain"); |
| 58 } | 59 } |
| 59 | 60 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (accessControlCredentialsString != "true") { | 161 if (accessControlCredentialsString != "true") { |
| 161 errorDescription = "Credentials flag is true, but Access-Control-All
ow-Credentials is not \"true\"."; | 162 errorDescription = "Credentials flag is true, but Access-Control-All
ow-Credentials is not \"true\"."; |
| 162 return false; | 163 return false; |
| 163 } | 164 } |
| 164 } | 165 } |
| 165 | 166 |
| 166 return true; | 167 return true; |
| 167 } | 168 } |
| 168 | 169 |
| 169 } // namespace WebCore | 170 } // namespace WebCore |
| OLD | NEW |