MCPcopy Index your code
hub / github.com/scality/cloudserver / parseRangeHeader

Function parseRangeHeader

lib/api/apiUtils/object/setUpCopyLocator.js:15–24  ·  view source on GitHub ↗

* Ensure an object copy part range header is of the form 'bytes=first-last'. * @param {string | undefined} header - header from request, if any * @return {object | null} custom error if header is incorrect form or null

(header)

Source from the content-addressed store, hash-verified

13 * @return {object | null} custom error if header is incorrect form or null
14 */
15function parseRangeHeader(header) {
16 const { error } = parseRangeSpec(header);
17 if (error) {
18 const description = 'The x-amz-copy-source-range value must be ' +
19 'of the form bytes=first-last where first and last are the ' +
20 'zero-based offsets of the first and last bytes to copy';
21 return error.customizeDescription(description);
22 }
23 return null;
24}
25
26/**
27 * Uses the source object metadata and the requestHeaders

Callers 1

setUpCopyLocatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected