Skip to content

Commit

Permalink
Merge pull request #2014 from BaseAdresseNationale/fbourcier/hotfix-p…
Browse files Browse the repository at this point in the history
…artial-range-donwload

hotfix Téléchargement partiel (Range header)
  • Loading branch information
IGNFBourcier authored Jan 23, 2025
2 parents c322f79 + 44b10b5 commit 3925fb0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/views/data/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const asyncSendS3 = (clientS3: AWS.S3) =>
res.setHeader('Accept-Ranges', AcceptRanges)
res.setHeader('Content-Range', ContentRange)
res.setHeader('Content-Length', ContentLength)
res.status(206)
res.statusCode = 206
}
(Body as NodeJS.ReadableStream)
?.on('error', (err: Error) => {
Expand All @@ -103,7 +103,10 @@ export const asyncSendS3 = (clientS3: AWS.S3) =>
})
.pipe(res)
})
.catch((err: Error) => console.error(err))
.catch((err: Error) => {
console.error(err)
reject(err)
})
}
)

Expand Down

0 comments on commit 3925fb0

Please sign in to comment.