Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/common/lib/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export class Range {
}
let range: Range = new Range(startByte, endByte, contentLength);
return range;
return;
}

toHeaderValue() {
if (this.startByte === null && this.endByte === null) {
throw Error("Failed to parse range object to a valid header value: " + JSON.stringify(this));
}

return `bytes=${this.startByte ?? ""}-${this.endByte ?? ""}`;
}
}
2 changes: 1 addition & 1 deletion lib/objectstorage/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ Any user with the OBJECTSTORAGE_NAMESPACE_READ permission will be able to see th
"if-match": getObjectRequest.ifMatch,
"if-none-match": getObjectRequest.ifNoneMatch,
"opc-client-request-id": getObjectRequest.opcClientRequestId,
"range": getObjectRequest.range,
"range": getObjectRequest.range?.toHeaderValue(),
"opc-sse-customer-algorithm": getObjectRequest.opcSseCustomerAlgorithm,
"opc-sse-customer-key": getObjectRequest.opcSseCustomerKey,
"opc-sse-customer-key-sha256": getObjectRequest.opcSseCustomerKeySha256
Expand Down