Archived
1
0

Use current URL for webview

This commit is contained in:
Asher
2019-08-12 10:23:08 -05:00
parent 1d61cbe536
commit 7389d9e2cb
3 changed files with 13 additions and 7 deletions

View File

@ -469,7 +469,6 @@ export class MainServer extends Server {
const workspacePath = parsedUrl.query.workspace as string | undefined;
const folderPath = !workspacePath ? parsedUrl.query.folder as string | undefined || this.options.folderUri || cwd: undefined;
const remoteAuthority = request.headers.host as string;
const webviewEndpoint = this.withBase(request, "/webview/");
const transformer = getUriTransformer(remoteAuthority);
const options: Options = {
WORKBENCH_WEB_CONGIGURATION: {
@ -480,7 +479,6 @@ export class MainServer extends Server {
? transformer.transformOutgoing(URI.file(sanitizeFilePath(folderPath, cwd)))
: undefined,
remoteAuthority,
webviewEndpoint,
},
REMOTE_USER_DATA_URI: transformer.transformOutgoing(
(this.services.get(IEnvironmentService) as EnvironmentService).webUserDataHome,
@ -497,7 +495,7 @@ export class MainServer extends Server {
for (const key in options) {
content = content.replace(`"{{${key}}}"`, `'${JSON.stringify(options[key as keyof Options])}'`);
}
content = content.replace('{{WEBVIEW_ENDPOINT}}', webviewEndpoint);
content = content.replace("{{WEBVIEW_ENDPOINT}}", "");
return { content, filePath };
}