Rah1x · GitHub

Fetch is no longer returning all rows of the same-name response headers! This only just happened after recent upgrade.

Environment

Environment:
OS: Windows 10
Node: 9.2.0
Yarn: 1.3.2
npm: 5.8.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.0.0.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: ^0.55.3 => 0.55.3

Steps to Reproduce

Server returns the following response

return response()->json(['msg'=>'1'], 200)
->withHeaders(['Content-Type'=>'application/json', 't1'=>[1, 2]]);

** react native code **

let response = await fetch('http://im-sick-and-tired-of-hunting-react-native-bugs',
{
            credentials: 'include',
            method: 'GET',
            cache: 'no-cache',
            mode: 'cors',
            headers: {'Cache-Control': 'no-cache', 'Accept':'*/*', 'Content-Type':'application/json'},
});
console.log(response.headers.get('t1'));

Expected Behavior

The test hdr (t1) must have both values but only the 2nd one is received. See the response from postman

image

Actual Behavior

image

Read the original on github.com ↗