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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 return headerSet.release(); | 90 return headerSet.release(); |
91 } | 91 } |
92 | 92 |
93 bool isOnAccessControlResponseHeaderWhitelist(const String& name) | 93 bool isOnAccessControlResponseHeaderWhitelist(const String& name) |
94 { | 94 { |
95 AtomicallyInitializedStatic(HTTPHeaderSet*, allowedCrossOriginResponseHeader s = createAllowedCrossOriginResponseHeadersSet().leakPtr()); | 95 AtomicallyInitializedStatic(HTTPHeaderSet*, allowedCrossOriginResponseHeader s = createAllowedCrossOriginResponseHeadersSet().leakPtr()); |
96 | 96 |
97 return allowedCrossOriginResponseHeaders->contains(name); | 97 return allowedCrossOriginResponseHeaders->contains(name); |
98 } | 98 } |
99 | 99 |
100 void updateRequestForAccessControl(ResourceRequest& request, StoredCredentials a llowCredentials) | |
101 { | |
102 request.removeCredentials(); | |
103 request.setAllowCookies(allowCredentials == AllowStoredCredentials); | |
104 } | |
105 | |
bbudge
2013/07/12 19:10:11
Why not allow a NULL securityOrigin parameter in t
ancilgeorge
2013/07/15 15:32:46
Done. Could you please review the changes.
| |
100 void updateRequestForAccessControl(ResourceRequest& request, SecurityOrigin* sec urityOrigin, StoredCredentials allowCredentials) | 106 void updateRequestForAccessControl(ResourceRequest& request, SecurityOrigin* sec urityOrigin, StoredCredentials allowCredentials) |
101 { | 107 { |
102 request.removeCredentials(); | 108 request.removeCredentials(); |
103 request.setAllowCookies(allowCredentials == AllowStoredCredentials); | 109 request.setAllowCookies(allowCredentials == AllowStoredCredentials); |
104 request.setHTTPOrigin(securityOrigin->toString()); | 110 request.setHTTPOrigin(securityOrigin->toString()); |
105 } | 111 } |
106 | 112 |
107 ResourceRequest createAccessControlPreflightRequest(const ResourceRequest& reque st, SecurityOrigin* securityOrigin) | 113 ResourceRequest createAccessControlPreflightRequest(const ResourceRequest& reque st, SecurityOrigin* securityOrigin) |
108 { | 114 { |
109 ResourceRequest preflightRequest(request.url()); | 115 ResourceRequest preflightRequest(request.url()); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 Vector<String> headers; | 180 Vector<String> headers; |
175 headerValue.split(',', false, headers); | 181 headerValue.split(',', false, headers); |
176 for (unsigned headerCount = 0; headerCount < headers.size(); headerCount++) { | 182 for (unsigned headerCount = 0; headerCount < headers.size(); headerCount++) { |
177 String strippedHeader = headers[headerCount].stripWhiteSpace(); | 183 String strippedHeader = headers[headerCount].stripWhiteSpace(); |
178 if (!strippedHeader.isEmpty()) | 184 if (!strippedHeader.isEmpty()) |
179 headerSet.add(strippedHeader); | 185 headerSet.add(strippedHeader); |
180 } | 186 } |
181 } | 187 } |
182 | 188 |
183 } // namespace WebCore | 189 } // namespace WebCore |
OLD | NEW |