Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#34627): forward Authorization header from original request on re… #36946

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

srascar-bubble
Copy link

@srascar-bubble srascar-bubble commented Apr 18, 2023

…direct

Fix #34627

Summary:

IOS Specific issue.
HTTP Authorization header is not passed to the sub-request when server responds with a 3xx code

Changelog:

[IOS] [FIXED] - Forward Authorization header from original request on redirect

Test Plan

  1. Start a bare project
  2. Install axios
  3. Create a simple http server with 2 endpoints where:
  • Both endpoints requires authentication (using jwt for example)
  • Endpoint A returns a redirect 307 to endpoint B
  1. Trigger an axios request to endpoint A
  • Expected 200 response code from endpoint B
  • Actual 401 response code from endpoint B

Additional information

It would be nice to have a little bit more control on this rule. Maybe limit header forwarding to urls with the same origin, or it applies if and only if an option is set at request creation (ex: forwardHeadersOnRedirect: true)

@facebook-github-bot
Copy link
Contributor

Hi @srascar-bubble!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,620,787 +0
android hermes armeabi-v7a 7,933,466 +0
android hermes x86 9,106,793 +0
android hermes x86_64 8,961,595 +0
android jsc arm64-v8a 9,186,843 +0
android jsc armeabi-v7a 8,377,136 +0
android jsc x86 9,244,445 +0
android jsc x86_64 9,502,916 +0

Base commit: 9e5c963
Branch: main

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 18, 2023
@Pranav-yadav Pranav-yadav added the 🌐Networking Related to a networking API. label Apr 27, 2023
@srascar-bubble
Copy link
Author

any update on this ?

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 8, 2023
@tom-sherman
Copy link

Can we expand the fix to forward all of the original headers, as is specified in the fetch standard?

ref: whatwg/fetch#553

@react-native-bot
Copy link
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 30, 2024
@Armster15
Copy link

Any reason for this not being merged? I remember this being quite a nasty bug

@react-native-bot react-native-bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. 🌐Networking Related to a networking API. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] Authorization header dropped when making HTTP requests that redirect
7 participants