Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: Source/WebCore/loader/CrossOriginAccessControl.cpp

Issue 7669010: Merge 93188 - REGRESSION (r89086): All worker xhr requests trigger preflight requests. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698