Skip to content

Commit

Permalink
fix(app-express): only treat getObject as iterable if not requesting …
Browse files Browse the repository at this point in the history
…a signed url
  • Loading branch information
TillaTheHun0 committed May 24, 2023
1 parent 1b9d08b commit 7af3d2d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/app-express/api/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,15 @@ export const storage = (services: HyperServices) => (app: Server) => {
app.get<NameParams>(
'/storage/:name/*',
bindCore(services),
({ params, query, storage }, res) =>
fork(
({ params, query, storage }, res) => {
/**
* If the request is wanting a signedUrl
* Then we know the request will be JSON containing the signedUrl
* not an iterable
*/
const isIterable = !isTrue(query.useSignedUrl)

return fork(
res,
200,
storage
Expand Down Expand Up @@ -217,8 +224,9 @@ export const storage = (services: HyperServices) => (app: Server) => {
const readableStream = result
return readableStream
}),
true,
),
isIterable,
)
},
)

app.delete(
Expand Down

0 comments on commit 7af3d2d

Please sign in to comment.