File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @inspatial/cloud" ,
3- "version" : " 0.6.15 " ,
3+ "version" : " 0.6.16 " ,
44 "license" : " Apache-2.0" ,
55 "exports" : {
66 "." : " ./mod.ts" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ export const publicFilesHandler: PathHandler = {
77 description : "Serve files that were uploaded as public files" ,
88 match : / ^ \/ f i l e s \/ ( .+ ) $ / ,
99 async handler ( inCloud , inRequest , inResponse ) {
10- const accountAndFileId = inRequest . path . replace ( / ^ \/ f i l e s \/ / , "" ) ;
10+ const thumbnail = inRequest . params . get ( "thumbnail" ) ;
11+ const accountAndFileId = inRequest . path . replace ( / ^ \/ f i l e s \/ / , "" ) +
12+ thumbnail
13+ ? "/thumb"
14+ : "" ;
1115 if ( ! accountAndFileId ) {
1216 raiseServerException ( 404 , "File not found" ) ;
1317 }
@@ -19,7 +23,10 @@ export const publicFilesHandler: PathHandler = {
1923 raiseServerException ( 404 , "File not found" ) ;
2024 }
2125 for await ( const item of Deno . readDir ( accontFolder ) ) {
22- if ( item . isFile && item . name . startsWith ( fileId ) ) {
26+ if (
27+ item . isFile &&
28+ item . name . startsWith ( `${ fileId } ${ thumbnail ? "-thumb" : "" } .` )
29+ ) {
2330 filePath = joinPath ( accountId , item . name ) ;
2431 inCloud . inCache . setValue ( "publicFiles" , accountAndFileId , filePath ) ;
2532 break ;
You can’t perform that action at this time.
0 commit comments