| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/net/clients/crw_csp_network_client.h" | 5 #import "ios/web/net/clients/crw_csp_network_client.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 #include <stddef.h> |
| 8 | 9 |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/macros.h" |
| 11 #import "ios/web/net/crw_url_verifying_protocol_handler.h" | 13 #import "ios/web/net/crw_url_verifying_protocol_handler.h" |
| 12 | 14 |
| 13 namespace { | 15 namespace { |
| 14 | 16 |
| 15 // HTTP headers for the content security policy. | 17 // HTTP headers for the content security policy. |
| 16 NSString* const kCSPHeaders[] { | 18 NSString* const kCSPHeaders[] { |
| 17 @"Content-Security-Policy", @"Content-Security-Policy-Report-Only", | 19 @"Content-Security-Policy", @"Content-Security-Policy-Report-Only", |
| 18 @"X-WebKit-CSP", @"X-WebKit-CSP-Report-Only" | 20 @"X-WebKit-CSP", @"X-WebKit-CSP-Report-Only" |
| 19 }; | 21 }; |
| 20 | 22 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Build a new response with |outputHeaders|. | 129 // Build a new response with |outputHeaders|. |
| 128 base::scoped_nsobject<NSHTTPURLResponse> outResponse( | 130 base::scoped_nsobject<NSHTTPURLResponse> outResponse( |
| 129 [[NSHTTPURLResponse alloc] initWithURL:[httpResponse URL] | 131 [[NSHTTPURLResponse alloc] initWithURL:[httpResponse URL] |
| 130 statusCode:[httpResponse statusCode] | 132 statusCode:[httpResponse statusCode] |
| 131 HTTPVersion:@"HTTP/1.1" | 133 HTTPVersion:@"HTTP/1.1" |
| 132 headerFields:outputHeaders]); | 134 headerFields:outputHeaders]); |
| 133 [super didReceiveResponse:outResponse]; | 135 [super didReceiveResponse:outResponse]; |
| 134 } | 136 } |
| 135 | 137 |
| 136 @end | 138 @end |
| OLD | NEW |