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

Cant set "origin" header with chrome extention #166

Open
Tineshnehete opened this issue Oct 9, 2022 · 1 comment
Open

Cant set "origin" header with chrome extention #166

Tineshnehete opened this issue Oct 9, 2022 · 1 comment

Comments

@Tineshnehete
Copy link

Issue

Due to security checks chrom blocks setting custom the headers. So we can set custom origin header for Api request.

Reason

We are using axios for proxying the request , but as axios uses xhr to make http request chrome blocks or restrict to set custome origin header .

Fix

To overcome we can update chrome extention and switch to https://developer.chrome.com/docs/extensions/reference/webRequest/
as far as i explored i can find any soln for axios proxy

@AndrewBastin
Copy link
Member

@Tineshnehete I have looked into the webRequest API for implementing this, but I am pretty sure we have an issue here.

From the statement in the WebRequest API explainer link you provided:

To intercept a sub-resource request, the extension needs to have access to both the requested URL and its initiator.

This is a problem for us as we cannot expect us to have access to the "requested URL" always. Hence, the browser will not let the interception to take place, I would love to be proven wrong though, because if this approach works, this can actually help with a lot of things for Hoppscotch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants