| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 request.setHTTPOrigin(securityOrigin->toAtomicString()); | 109 request.setHTTPOrigin(securityOrigin->toAtomicString()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 ResourceRequest createAccessControlPreflightRequest(const ResourceRequest& reque
st, SecurityOrigin* securityOrigin) | 112 ResourceRequest createAccessControlPreflightRequest(const ResourceRequest& reque
st, SecurityOrigin* securityOrigin) |
| 113 { | 113 { |
| 114 ResourceRequest preflightRequest(request.url()); | 114 ResourceRequest preflightRequest(request.url()); |
| 115 updateRequestForAccessControl(preflightRequest, securityOrigin, DoNotAllowSt
oredCredentials); | 115 updateRequestForAccessControl(preflightRequest, securityOrigin, DoNotAllowSt
oredCredentials); |
| 116 preflightRequest.setHTTPMethod("OPTIONS"); | 116 preflightRequest.setHTTPMethod("OPTIONS"); |
| 117 preflightRequest.setHTTPHeaderField("Access-Control-Request-Method", request
.httpMethod()); | 117 preflightRequest.setHTTPHeaderField("Access-Control-Request-Method", request
.httpMethod()); |
| 118 preflightRequest.setPriority(request.priority()); | 118 preflightRequest.setPriority(request.priority()); |
| 119 preflightRequest.setTargetType(request.targetType()); |
| 119 | 120 |
| 120 const HTTPHeaderMap& requestHeaderFields = request.httpHeaderFields(); | 121 const HTTPHeaderMap& requestHeaderFields = request.httpHeaderFields(); |
| 121 | 122 |
| 122 if (requestHeaderFields.size() > 0) { | 123 if (requestHeaderFields.size() > 0) { |
| 123 StringBuilder headerBuffer; | 124 StringBuilder headerBuffer; |
| 124 HTTPHeaderMap::const_iterator it = requestHeaderFields.begin(); | 125 HTTPHeaderMap::const_iterator it = requestHeaderFields.begin(); |
| 125 headerBuffer.append(it->key); | 126 headerBuffer.append(it->key); |
| 126 ++it; | 127 ++it; |
| 127 | 128 |
| 128 HTTPHeaderMap::const_iterator end = requestHeaderFields.end(); | 129 HTTPHeaderMap::const_iterator end = requestHeaderFields.end(); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 request.setHTTPOrigin(securityOrigin->toAtomicString()); | 267 request.setHTTPOrigin(securityOrigin->toAtomicString()); |
| 267 // If the user didn't request credentials in the first place, update our | 268 // If the user didn't request credentials in the first place, update our |
| 268 // state so we neither request them nor expect they must be allowed. | 269 // state so we neither request them nor expect they must be allowed. |
| 269 if (options.credentialsRequested == ClientDidNotRequestCredentials) | 270 if (options.credentialsRequested == ClientDidNotRequestCredentials) |
| 270 options.allowCredentials = DoNotAllowStoredCredentials; | 271 options.allowCredentials = DoNotAllowStoredCredentials; |
| 271 } | 272 } |
| 272 return true; | 273 return true; |
| 273 } | 274 } |
| 274 | 275 |
| 275 } // namespace WebCore | 276 } // namespace WebCore |
| OLD | NEW |