未验证 提交 5c163998 编写于 作者: A Asher

Fix accessing versioned resource using file service

Fixes #986.
上级 0141ded3
...@@ -164,8 +164,8 @@ export class FileProviderChannel implements IServerChannel, IDisposable { ...@@ -164,8 +164,8 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
private transform(resource: UriComponents): URI { private transform(resource: UriComponents): URI {
// Used for walkthrough content. // Used for walkthrough content.
if (resource.path.indexOf("/static") === 0) { if (/^\/static[^/]*\//.test(resource.path)) {
return URI.file(this.environmentService.appRoot + resource.path.replace(/^\/static/, "")); return URI.file(this.environmentService.appRoot + resource.path.replace(/^\/static[^/]*\//, "/"));
// Used by the webview service worker to load resources. // Used by the webview service worker to load resources.
} else if (resource.path === "/vscode-resource" && resource.query) { } else if (resource.path === "/vscode-resource" && resource.query) {
try { try {
......
...@@ -279,7 +279,7 @@ export abstract class Server { ...@@ -279,7 +279,7 @@ export abstract class Server {
// without adding query parameters which have their own issues. // without adding query parameters which have their own issues.
// REVIEW: Discuss whether this is the best option; this is sort of a quick // REVIEW: Discuss whether this is the best option; this is sort of a quick
// hack almost to get caching in the meantime but it does work pretty well. // hack almost to get caching in the meantime but it does work pretty well.
if (/static-.+/.test(base)) { if (/^\/static-.+/.test(base)) {
base = "/static"; base = "/static";
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册