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

pass webview URIs as is #6282

Closed
AlexTugarev opened this issue Sep 27, 2019 · 4 comments · Fixed by #6465
Closed

pass webview URIs as is #6282

AlexTugarev opened this issue Sep 27, 2019 · 4 comments · Fixed by #6465
Assignees
Labels
bug bugs found in the application vscode issues related to VSCode compatibility webviews issues related to webviews

Comments

@AlexTugarev
Copy link
Contributor

Description

in the plugin system we're patching the html content forwarded to webviews by replacing vscode-resource:/ with /webview/ in the assumption that the context path of theia is /. this will break if you put e.g. an nginx proxy in front of theia and use a location prefix. the expectation is then that the path is /some/prefix/webview with will be passed to the /webview endpoint of theia's express server.

#5619 tried to solve this issue by turning them into relative urls; I reverted in #6279 because it broke the webviews from python extension.

an alternative approach to solve this issue is described briefly in #6279 (comment); the idea is to make it configurable.

cc. @amiramw

@AlexTugarev AlexTugarev added bug bugs found in the application vscode issues related to VSCode compatibility labels Sep 27, 2019
@akosyakov
Copy link
Member

akosyakov commented Sep 27, 2019

I wonder should not we rather redesign the endpoint to send URIs as is without trying to make them part of a URL, as proposed here: #5619 (comment)

The issue is that browsers can modify URLs i.e. remove .. and . leading to another URI. If we send resource URl as a string as a part of POST body we make sure that no browser or proxy will intervene with handling it, and backend services receive it in the way how it is defined.

cc @svenefftinge @olexii4 @eclipse-theia/plugin-system

@akosyakov akosyakov added the webviews issues related to webviews label Sep 27, 2019
@AlexTugarev
Copy link
Contributor Author

@akosyakov can you explain this, please?

vscode extensions might want to push html content like this <script src="vscode-resource://tmp/path/to/bundle.js"> as webview content. what would you suggest to change, in order to let the browser fetch these resources?

@akosyakov
Copy link
Member

akosyakov commented Sep 27, 2019

@amiramw
Copy link
Member

amiramw commented Sep 27, 2019

an alternative approach to solve this issue is described briefly in #6279 (comment); the idea is to make it configurable.

@AlexTugarev Will this approach solve also the python webview scenario?

@akosyakov akosyakov changed the title Webview might not work with proxy location pass webview URIs as is Oct 13, 2019
@akosyakov akosyakov self-assigned this Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application vscode issues related to VSCode compatibility webviews issues related to webviews
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants