-
Notifications
You must be signed in to change notification settings - Fork 56
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
Auth Header in Fetch Redirects (Chrome v119+) #502
Comments
To provide a bit of extra context, this change was made to align with the spec and sounds like it is already the behaviour in Firefox and Safari: https://groups.google.com/a/chromium.org/g/blink-dev/c/3Zt4UHbynYA/m/9CZ3fFdnAQAJ I think an interesting question to ask is if we should provide something to support this use case in DNR. I'm not immediately sure what that would look like, but this seems like a reasonable use case. |
Since the MV3 timeline has also been released, we'd appreciate some solution for MV3. A separate line of thought is whether browsers should consider redirects to localhost/127.0.0.1 as cross-origin redirects. IMO redirects to localhost(s) should be fine, and auth headers should be passed along. This will not solve 100% of the problem but should cater to a bit though. |
@sachinjain024 Is this still an issue for your extension? Looks like you had a fix which was reverted at some point. |
I recently found this to also be the case for any custom headers provided (that I had tested) unless the URL was included in Downloading & running these will show a not valid json error etc.. as these are dummy api urls, but if you remove the entry from the host permissions it will have a cors due to the custom header. Examples: |
@bershanskiy For MV2, we have found a fix. We had to revert it because of a regression, but the solution won't work for MV3. For MV2, we have monkey patched the In the onBeforeSendHeaders handle, we copied the x-auth to the auth header and removed the x-auth header. We also had to handle the CORS issue due to adding this custom auth header. We can't take this approach in MV3, as we don't have the necessary controls with MV3 API due to its declarative nature, and that's why it is important for us to have a solution for this when we do the complete MV3 migration. We're almost 80% done with our MV3 migration; this is a blocker for us. We will really appreciate any help here! |
Upon investigation, it has come to attention that this change affects not only |
I've left a comment in the fetch WG summarising the feedback here: whatwg/fetch#1631 So far, this only seems to impact a small number of unique use cases. I appreciate that in those cases, this is very important of course, but it does make it harder to prioritize any changes to either the web API or extensions. Please keep the feedback coming especially if there are any new use cases. In the meantime, I'll keep an eye out for updates in the fetch issue. |
Hey everyone, We're building Requestly - An Open-Source Chrome extension to intercept & modify HTTPs requests. One of the major use cases of Requestly is to redirect the APIs from production to the staging/local dev environment.
Post chrome v11 release in the first week of November, lots of Requestly users have started complaining that their redirects have started failing with 401 error. Here is the github issue in Requestly repo.
Upon further investigation, we found this happening in Chrome v119+ users. We would like to know how to solve this in MV2 and MV3, respectively.
One suggestion for MV2 is to monkey-patch the
fetch
request and pass the auth header to the background to add the auth header explicitly in the case of cross-origin redirect. This might work, although it seems too hacky of a solution.We couldn't think of any solution in the MV3 approach. We'd appreciate the help here.
The text was updated successfully, but these errors were encountered: