Repository navigation
Closed
Labels
StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Is this a bug report?
Yes
Android use fetch dont't work with "deflate" encoded responses.json().
I copy the same fetch in browser try to it will response the right encoded json.
Environment
react-native -v: 0.47.2node -v: 8.0.0npm -v: 5.3.0
Then, specify:
-
Target Platform: Android
-
Development Operating System: Windows
-
Build tools: Android SDK
Steps to Reproduce
fetch(url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
},
body: JSON.stringify(options),
compress: true,
})
.then((response) => {
console.log(response);
return response.json();
})
.then((result) => {
// result is messy code
});
Expected Behavior
right to encoded.
Actual Behavior
return messy code
Reproducible Demo
Unhandled Promise Rejection (id: 0):
SyntaxError: Unexpected token { in JSON at position 0
at parse (<anonymous>)
at tryCallOne (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:13773:12)
at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:13859:15
at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:5290:19
at _callTimer (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:5204:7)
at Object.callImmediatesPass (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:5432:9)
at Object.callImmediates (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:5443:21)
at MessageQueue.__callImmediates (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:4803:16)
at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:4689:16
at MessageQueue.__guard (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:4789:9)
Metadata
Metadata
Assignees
Labels
StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Activity
stale commentedon Nov 6, 2017
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.