Attempt to read headers with duplicate keys using different approach

This commit is contained in:
Vladimir Enchev
2016-03-24 15:51:09 +02:00
parent a05ce51cbb
commit 86274bd660

View File

@ -67,14 +67,10 @@ export function request(options: http.HttpRequestOptions): Promise<http.HttpResp
var headers: http.Headers = {};
if (response && response.allHeaderFields) {
var headerFields = response.allHeaderFields;
var keys = headerFields.allKeys;
for (var i = 0, l = keys.count; i < l; i++) {
let key = keys.objectAtIndex(i);
let value = headerFields.valueForKey(key);
headerFields.enumerateKeysAndObjectsUsingBlock((key, value, stop) => {
(<any>http).addHeader(headers, key, value);
}
});
}
if (debugRequest) {