Skip to content

fetch() response URL is incorrect after redirect #55248

Closed

Description

@MarkCSmith

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

MarkCSmith@f463507

Screenshots and Videos

No response

Activity

  1. MarkCSmith commented on Jan 20, 2026

    @MarkCSmith
    ContributorAuthor

    I added a PR. Quoting from the spec at https://fetch.spec.whatwg.org/#concept-response:

    A response has an associated URL. It is a pointer to the last URL in response’s URL list and null if response’s URL list is empty.

  2. added a commit that references this issue on Jan 20, 2026
    fbe6a68
  3. added a commit that references this issue on Feb 2, 2026
    8d561b0
  4. AnisDerbel commented on Feb 10, 2026

    @AnisDerbel

    @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

  5. MarkCSmith commented on Feb 11, 2026

    @MarkCSmith
    ContributorAuthor

    @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!

    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.

  6. tomaszukovskij commented on Mar 3, 2026

    @tomaszukovskij

    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.

  7. ArGeoph commented on Apr 14, 2026

    @ArGeoph

    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?

  8. added a commit that references this issue on Jun 23, 2026
    70d1291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: FixedA PR that fixes this issue has been merged.🌐NetworkingRelated to a networking API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions