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

CORSANYWHERE_TARGETWHITELIST allows proxy owner to specify targets that are allowed to be proxied through the server #414

Closed
wants to merge 3 commits into from

Conversation

gwxtqryio98
Copy link

No description provided.

Proxy owner can supply comma separated list of whitelisted targets that are allowed to be proxied through the server
Server will now reject requests to any target that was not whitelisted by the proxy owner
@@ -370,6 +371,12 @@ function getHandler(options, proxy) {
res.end('The origin "' + origin + '" was not whitelisted by the operator of this proxy.');
return;
}

if (corsAnywhere.targetWhitelist.length && corsAnywhere.targetWhitelist.indexOf(location.href) === -1) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use case for this? This exact match is quite inflexible. If you use cors-anywhere as a library, then you can already enforce this kind of target restriction by comparing req.url.slice(1) with the target whitelist.

To learn more about potential implementation details to improve the design, see #78. See also the review feedback at #111.

This pull request was closed.
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

Successfully merging this pull request may close these issues.

None yet

2 participants