Skip to content

Commit

Permalink
send back the content-range header
Browse files Browse the repository at this point in the history
This header will be used to determine whether the whole body has been retrieved

OHM-1039
  • Loading branch information
bradsawadye committed Oct 27, 2020
1 parent 1101837 commit 6a804c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export async function getTransactionBodyById (ctx, transactionId, bodyId) {
ctx.status = rangeHeader ? 206 : 200
ctx.set('accept-ranges', 'bytes')
ctx.set('content-type', 'application/text')
ctx.set('access-control-expose-headers', 'content-range, content-length, content-type')
if (rangeHeader) {
ctx.set('content-range', `bytes ${range.start}-${range.end}/${body.fileDetails.length}`)
ctx.set('content-length', Math.min((range.end - range.start) + 1, body.fileDetails.length))
Expand Down

0 comments on commit 6a804c7

Please sign in to comment.