Skip to content

Commit

Permalink
feat(Server): add flag to disable range
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Jul 29, 2022
1 parent 7d5a5f5 commit c74ee71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/js/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ class Response extends Writable {
stream.on('error', this._pipeError.bind(this))
}

pipeFrom (stream) {
pipeFrom (stream, allowRange = true) {
if (this._writableState.destroyed) {
return
}
this._setupStreamMeta(stream)
const ranges = this._status === 200 &&
const ranges = allowRange && this._status === 200 &&
parseRange(this._totalSize, this.connection.headers.range || '', { combine: true })
// TODO: Support for multipart/byteranges
if (Array.isArray(ranges) && ranges.length === 1 && ranges.type === 'bytes') {
Expand Down

0 comments on commit c74ee71

Please sign in to comment.