| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ios/net/http_response_headers_util.h" | 5 #include "ios/net/http_response_headers_util.h" |
| 6 | 6 |
| 7 #include <Foundation/Foundation.h> | 7 #include <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 scoped_refptr<HttpResponseHeaders> http_headers( | 33 scoped_refptr<HttpResponseHeaders> http_headers( |
| 34 new HttpResponseHeaders(status_line)); | 34 new HttpResponseHeaders(status_line)); |
| 35 // Iterate through |response|'s headers and add them to |http_headers|. | 35 // Iterate through |response|'s headers and add them to |http_headers|. |
| 36 [response.allHeaderFields | 36 [response.allHeaderFields |
| 37 enumerateKeysAndObjectsUsingBlock:^(NSString* header_name, | 37 enumerateKeysAndObjectsUsingBlock:^(NSString* header_name, |
| 38 NSString* value, BOOL*) { | 38 NSString* value, BOOL*) { |
| 39 NSString* header_line = | 39 NSString* header_line = |
| 40 [NSString stringWithFormat:kHeaderLineFormat, header_name, value]; | 40 [NSString stringWithFormat:kHeaderLineFormat, header_name, value]; |
| 41 http_headers->AddHeader(base::SysNSStringToUTF8(header_line)); | 41 http_headers->AddHeader(base::SysNSStringToUTF8(header_line)); |
| 42 }]; | 42 }]; |
| 43 return http_headers.Pass(); | 43 return http_headers; |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespae net | 46 } // namespae net |
| OLD | NEW |