File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ export abstract class Server {
193193 return { content : await util . promisify ( fs . readFile ) ( filePath ) , filePath } ;
194194 }
195195
196+ protected async getAnyResource ( ...parts : string [ ] ) : Promise < Response > {
197+ const filePath = path . join ( ...parts ) ;
198+ return { content : await util . promisify ( fs . readFile ) ( filePath ) , filePath } ;
199+ }
200+
196201 protected async getTarredResource ( ...parts : string [ ] ) : Promise < Response > {
197202 const filePath = this . ensureAuthorizedFilePath ( ...parts ) ;
198203 return { stream : tarFs . pack ( filePath ) , filePath, mime : "application/tar" , cache : true } ;
@@ -524,7 +529,7 @@ export class MainServer extends Server {
524529 break ;
525530 case "/webview" :
526531 if ( / ^ \/ v s c o d e - r e s o u r c e / . test ( requestPath ) ) {
527- return this . getResource ( requestPath . replace ( / ^ \/ v s c o d e - r e s o u r c e ( \/ f i l e ) ? / , "" ) ) ;
532+ return this . getAnyResource ( requestPath . replace ( / ^ \/ v s c o d e - r e s o u r c e ( \/ f i l e ) ? / , "" ) ) ;
528533 }
529534 return this . getResource (
530535 this . rootPath ,
You can’t perform that action at this time.
0 commit comments