File tree 1 file changed +6
-1
lines changed
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 {
193
193
return { content : await util . promisify ( fs . readFile ) ( filePath ) , filePath } ;
194
194
}
195
195
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
+
196
201
protected async getTarredResource ( ...parts : string [ ] ) : Promise < Response > {
197
202
const filePath = this . ensureAuthorizedFilePath ( ...parts ) ;
198
203
return { stream : tarFs . pack ( filePath ) , filePath, mime : "application/tar" , cache : true } ;
@@ -524,7 +529,7 @@ export class MainServer extends Server {
524
529
break ;
525
530
case "/webview" :
526
531
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 ) ? / , "" ) ) ;
528
533
}
529
534
return this . getResource (
530
535
this . rootPath ,
You can’t perform that action at this time.
0 commit comments