mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Attempt to read headers with duplicate keys using different approach
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user