Repository navigation
fetch() response URL is incorrect after redirect #55248
Copy link
Copy link
Closed
Labels
Resolution: FixedA PR that fixes this issue has been merged.A PR that fixes this issue has been merged.🌐NetworkingRelated to a networking API.Related to a networking API.
Description
Description
In recent versions of React Native, fetch() always returns the original URL in the response object. Per the fetch specification, if a redirect was followed the response should contain the final URL.
Steps to reproduce
Click the Get button within the provided reproducer. It uses fetch() to GET https://www.github.com/. The expectation is that the URL from the response object will be https://github.com/ (after redirect),
React Native Version
0.82.1
Affected Platforms
Runtime - Android, Build - MacOS
Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
OS: macOS 15.7.2
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 249.28 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 24.11.1
path: /usr/local/opt/node@24/bin/node
Yarn:
version: 1.22.22
path: /usr/local/bin/yarn
npm:
version: 11.6.2
path: /usr/local/opt/node@24/bin/npm
Watchman:
version: 2025.04.14.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.5
- iOS 18.5
- macOS 15.5
- tvOS 18.5
- visionOS 2.5
- watchOS 11.5
Android SDK:
API Levels:
- "29"
- "30"
- "31"
- "33"
- "34"
- "35"
- "36"
Build Tools:
- 29.0.2
- 29.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 34.0.0
- 34.0.0
- 35.0.0
- 35.0.1
- 36.0.0
System Images:
- android-30 | Google APIs Intel x86 Atom
- android-30 | Google Play Intel x86 Atom
- android-33 | Google APIs Intel x86_64 Atom
- android-33 | Google Play Intel x86_64 Atom
- android-35 | Google Play Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Xcode:
version: 16.4/16F6
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.1.1
wanted: 19.1.1
react-native:
installed: 0.82.1
wanted: 0.82.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
info React Native v0.83.0 is now available (your project is running on v0.82.1).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.83.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.82.1&to=0.83.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Stacktrace or Logs
N/A
MANDATORY Reproducer
Screenshots and Videos
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution: FixedA PR that fixes this issue has been merged.A PR that fixes this issue has been merged.🌐NetworkingRelated to a networking API.Related to a networking API.
Activity
MarkCSmith commentedon Jan 20, 2026
I added a PR. Quoting from the spec at https://fetch.spec.whatwg.org/#concept-response:
Include final (redirected to) URL in response object. Fixes #55248. (#…
Include final (redirected to) URL in response object. Fixes #55248. (#…
AnisDerbel commentedon Feb 10, 2026
@MarkCSmith it is mentioned in the Readme that this fix is included in v0.83.2 but it is actually not , can you please check!
https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0832
MarkCSmith commentedon Feb 11, 2026
You are correct; my fix was not included. I do not know enough about the React Native release process to know why it is listed in the changelog even though the PR was not merged into the 0.83.x branch.
tomaszukovskij commentedon Mar 3, 2026
The same is happening with the axios. Just updated from RN 0.80 to 0.82. It does not return final url but the original url instead.
ArGeoph commentedon Apr 14, 2026
This bug is still reproducible in RN 0.83.5, even though it was supposed to get fixed in RN 0.83.2 @cortinico can you please look into that?
Include final (redirected to) URL in response object. Fixes #55248. (#…