Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Nov 2, 2024
1 parent 86d83ca commit 9ac354a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ class BaseUpload {
return
}

if (![PROTOCOL_TUS_V1, PROTOCOL_IETF_DRAFT_03, PROTOCOL_IETF_DRAFT_05].includes(this.options.protocol)) {
if (
![PROTOCOL_TUS_V1, PROTOCOL_IETF_DRAFT_03, PROTOCOL_IETF_DRAFT_05].includes(
this.options.protocol,
)
) {
this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`))
return
}
Expand Down Expand Up @@ -597,7 +601,10 @@ class BaseUpload {
this._offset = 0
promise = this._addChunkToRequest(req)
} else {
if (this.options.protocol === PROTOCOL_IETF_DRAFT_03 || this.options.protocol === PROTOCOL_IETF_DRAFT_05) {
if (
this.options.protocol === PROTOCOL_IETF_DRAFT_03 ||
this.options.protocol === PROTOCOL_IETF_DRAFT_05
) {
req.setHeader('Upload-Complete', '?0')
}
promise = this._sendRequest(req, null)
Expand Down Expand Up @@ -837,7 +844,10 @@ class BaseUpload {
return this._sendRequest(req)
}

if (this.options.protocol === PROTOCOL_IETF_DRAFT_03 || this.options.protocol === PROTOCOL_IETF_DRAFT_05) {
if (
this.options.protocol === PROTOCOL_IETF_DRAFT_03 ||
this.options.protocol === PROTOCOL_IETF_DRAFT_05
) {
req.setHeader('Upload-Complete', done ? '?1' : '?0')
}
this._emitProgress(this._offset, this._size)
Expand Down

0 comments on commit 9ac354a

Please sign in to comment.