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

Handle extension resources on server #141572

Merged
merged 8 commits into from
Jan 27, 2022
Merged

Conversation

sandy081
Copy link
Member

Handle extension resources on server

@sandy081 sandy081 added this to the January 2022 milestone Jan 26, 2022
@sandy081 sandy081 self-assigned this Jan 26, 2022
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

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

Nice! I just left a couple of suggestions.

src/vs/server/node/webClientServer.ts Outdated Show resolved Hide resolved
src/vs/server/node/webClientServer.ts Show resolved Hide resolved
@monken
Copy link

monken commented Jan 27, 2022

What’s the rationale for this feature? It seems to create a completely open reverse proxy to any domain on the internet (and worse, the private networks that the server has access to). The browser handles cross origin request in a separate security context (which is what you want), this feature will effectively disable these safeguards.

@sandy081
Copy link
Member Author

@monken Thanks for your feedback and very much appreciated. This is not targeting any server/domain in the internet. This is to redirect requests to the service (we are hosting) from the client to the server. We have strict CORS rules on this service of ours and its blocking the dev set up and testing. Instead of loosening the CORS rules (which is not ideal) we are redirecting these specific requests through server. Hope it is clear.

- Set selective request and response headers
- Update the scheme on the client
@sandy081
Copy link
Member Author

Updated the PR to support following:

  • Added a check on the server to validate if the URL is pointing to the target service or not.
  • Selectively set request and response headers
  • Client updates the protocol (http or https) of the URL correctly.

@alexdima @bpasero Please take a look at the changes.

@sandy081 sandy081 merged commit 718af04 into main Jan 27, 2022
@sandy081 sandy081 deleted the sandy081/extensionResourceHandler branch January 27, 2022 17:22
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants