Skip to content

Commit 746dc5c

Browse files
committed
Fix issue where web views do not use relative URLs.
1 parent 876cb34 commit 746dc5c

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/vs/server/webClientServer.ts

+2-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import * as fs from 'fs';
77
import * as http from 'http';
8-
import * as path from 'path';
98
import * as url from 'url';
109
import * as util from 'util';
1110
import * as cookie from 'cookie';
@@ -166,15 +165,6 @@ export class WebClientServer {
166165
};
167166
}
168167

169-
/**
170-
* A convenience method which creates a URL prefixed with a relative path.
171-
*/
172-
private createRequestUrl(req: http.IncomingMessage, parsedUrl: url.UrlWithParsedQuery, pathname: string): URL {
173-
const pathPrefix = getPathPrefix(parsedUrl.pathname!);
174-
const remoteAuthority = this.getRemoteAuthority(req);
175-
return new URL(path.join('/', pathPrefix, pathname), remoteAuthority);
176-
}
177-
178168
private _iconSizes = [192, 512];
179169

180170
private getRemoteAuthority(req: http.IncomingMessage): URL {
@@ -346,8 +336,8 @@ export class WebClientServer {
346336

347337
// Endpoints
348338
logoutEndpointUrl: './logout',
349-
webEndpointUrl: this.createRequestUrl(req, parsedUrl, '/static').toString(),
350-
webEndpointUrlTemplate: this.createRequestUrl(req, parsedUrl, '/static').toString(),
339+
webEndpointUrl: './static',
340+
webEndpointUrlTemplate: './static',
351341
webviewContentExternalBaseUrlTemplate: './webview/{{uuid}}/',
352342

353343
updateUrl: './update/check'

0 commit comments

Comments
 (0)