| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Access-Control-Request-Headers header. | 101 // Access-Control-Request-Headers header. |
| 102 continue; | 102 continue; |
| 103 } | 103 } |
| 104 headers.append(header.key.lower()); | 104 headers.append(header.key.lower()); |
| 105 } | 105 } |
| 106 // Sort header names lexicographically. | 106 // Sort header names lexicographically. |
| 107 std::sort(headers.begin(), headers.end(), WTF::codePointCompareLessThan)
; | 107 std::sort(headers.begin(), headers.end(), WTF::codePointCompareLessThan)
; |
| 108 StringBuilder headerBuffer; | 108 StringBuilder headerBuffer; |
| 109 for (const String& header : headers) { | 109 for (const String& header : headers) { |
| 110 if (!headerBuffer.isEmpty()) | 110 if (!headerBuffer.isEmpty()) |
| 111 headerBuffer.append(", "); | 111 headerBuffer.appendLiteral(", "); |
| 112 headerBuffer.append(header); | 112 headerBuffer.append(header); |
| 113 } | 113 } |
| 114 preflightRequest.setHTTPHeaderField(HTTPNames::Access_Control_Request_He
aders, AtomicString(headerBuffer.toString())); | 114 preflightRequest.setHTTPHeaderField(HTTPNames::Access_Control_Request_He
aders, AtomicString(headerBuffer.toString())); |
| 115 } | 115 } |
| 116 | 116 |
| 117 return preflightRequest; | 117 return preflightRequest; |
| 118 } | 118 } |
| 119 | 119 |
| 120 static bool isOriginSeparator(UChar ch) | 120 static bool isOriginSeparator(UChar ch) |
| 121 { | 121 { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 newRequest.setHTTPOrigin(securityOrigin); | 326 newRequest.setHTTPOrigin(securityOrigin); |
| 327 // If the user didn't request credentials in the first place, update our | 327 // If the user didn't request credentials in the first place, update our |
| 328 // state so we neither request them nor expect they must be allowed. | 328 // state so we neither request them nor expect they must be allowed. |
| 329 if (options.credentialsRequested == ClientDidNotRequestCredentials) | 329 if (options.credentialsRequested == ClientDidNotRequestCredentials) |
| 330 options.allowCredentials = DoNotAllowStoredCredentials; | 330 options.allowCredentials = DoNotAllowStoredCredentials; |
| 331 } | 331 } |
| 332 return true; | 332 return true; |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace blink | 335 } // namespace blink |
| OLD | NEW |