File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @inspatial/cloud" ,
3- "version" : " 0.6.16 " ,
3+ "version" : " 0.6.17 " ,
44 "license" : " Apache-2.0" ,
55 "exports" : {
66 "." : " ./mod.ts" ,
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ export const publicFilesHandler: PathHandler = {
88 match : / ^ \/ f i l e s \/ ( .+ ) $ / ,
99 async handler ( inCloud , inRequest , inResponse ) {
1010 const thumbnail = inRequest . params . get ( "thumbnail" ) ;
11- const accountAndFileId = inRequest . path . replace ( / ^ \/ f i l e s \/ / , "" ) +
12- thumbnail
13- ? "/ thumb"
14- : "" ;
11+ let accountAndFileId = inRequest . path . replace ( / ^ \/ f i l e s \/ / , "" ) ;
12+ if ( thumbnail ) {
13+ accountAndFileId = accountAndFileId += "- thumb";
14+ }
1515 if ( ! accountAndFileId ) {
1616 raiseServerException ( 404 , "File not found" ) ;
1717 }
@@ -25,7 +25,7 @@ export const publicFilesHandler: PathHandler = {
2525 for await ( const item of Deno . readDir ( accontFolder ) ) {
2626 if (
2727 item . isFile &&
28- item . name . startsWith ( `${ fileId } ${ thumbnail ? "-thumb" : "" } .` )
28+ item . name . startsWith ( `${ fileId } .` )
2929 ) {
3030 filePath = joinPath ( accountId , item . name ) ;
3131 inCloud . inCache . setValue ( "publicFiles" , accountAndFileId , filePath ) ;
You can’t perform that action at this time.
0 commit comments