* 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)
| 13 | * @return {object | null} custom error if header is incorrect form or null |
| 14 | */ |
| 15 | function 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 |