| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011, 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return; | 214 return; |
| 215 } | 215 } |
| 216 | 216 |
| 217 HTTPHeaderSet exposedHeaders; | 217 HTTPHeaderSet exposedHeaders; |
| 218 extractCorsExposedHeaderNamesList(response, exposedHeaders); | 218 extractCorsExposedHeaderNamesList(response, exposedHeaders); |
| 219 HTTPHeaderSet blockedHeaders; | 219 HTTPHeaderSet blockedHeaders; |
| 220 for (const auto& header : response.httpHeaderFields()) { | 220 for (const auto& header : response.httpHeaderFields()) { |
| 221 if (FetchUtils::isForbiddenResponseHeaderName(header.key) || | 221 if (FetchUtils::isForbiddenResponseHeaderName(header.key) || |
| 222 (!isOnAccessControlResponseHeaderWhitelist(header.key) && | 222 (!isOnAccessControlResponseHeaderWhitelist(header.key) && |
| 223 !exposedHeaders.contains(header.key))) | 223 !exposedHeaders.contains(header.key))) |
| 224 blockedHeaders.add(header.key); | 224 blockedHeaders.insert(header.key); |
| 225 } | 225 } |
| 226 | 226 |
| 227 if (blockedHeaders.isEmpty()) { | 227 if (blockedHeaders.isEmpty()) { |
| 228 // Use the original ResourceResponse. | 228 // Use the original ResourceResponse. |
| 229 m_client->didReceiveResponse(WrappedResourceResponse(response)); | 229 m_client->didReceiveResponse(WrappedResourceResponse(response)); |
| 230 return; | 230 return; |
| 231 } | 231 } |
| 232 | 232 |
| 233 // If there are blocked headers, copy the response so we can remove them. | 233 // If there are blocked headers, copy the response so we can remove them. |
| 234 WebURLResponse validatedResponse = WrappedResourceResponse(response); | 234 WebURLResponse validatedResponse = WrappedResourceResponse(response); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // there could be a WebURLLoader instance behind the | 496 // there could be a WebURLLoader instance behind the |
| 497 // DocumentThreadableLoader instance. So, for safety, we chose to just | 497 // DocumentThreadableLoader instance. So, for safety, we chose to just |
| 498 // crash here. | 498 // crash here. |
| 499 CHECK(ThreadState::current()); | 499 CHECK(ThreadState::current()); |
| 500 | 500 |
| 501 m_observer->dispose(); | 501 m_observer->dispose(); |
| 502 m_observer = nullptr; | 502 m_observer = nullptr; |
| 503 } | 503 } |
| 504 | 504 |
| 505 } // namespace blink | 505 } // namespace blink |
| OLD | NEW |