MCPcopy Index your code
hub / github.com/nodejs/node / getOffsetLength

Function getOffsetLength

test/parallel/test-http2-respond-file-fd-range.js:25–30  ·  view source on GitHub ↗
(range)

Source from the content-addressed store, hash-verified

23// Note: this is not anywhere close to a proper implementation of the range
24// header.
25function getOffsetLength(range) {
26 if (range === undefined)
27 return [0, -1];
28 const r = /bytes=(\d+)-(\d+)/.exec(range);
29 return [+r[1], +r[2] - +r[1]];
30}
31
32const server = http2.createServer();
33server.on('stream', common.mustCallAtLeast((stream, headers) => {

Calls 1

execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…