MCPcopy Index your code
hub / github.com/nodejs/llhttp / checkVersion

Method checkVersion

src/llhttp/http.ts:304–325  ·  view source on GitHub ↗
(destination: string)

Source from the content-addressed store, hash-verified

302 .otherwise(p.error(ERROR.INVALID_CONSTANT, 'Invalid word encountered'));
303
304 const checkVersion = (destination: string): Node => {
305 const node = n(destination);
306 const errorNode = this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Invalid HTTP version'));
307
308 return this.testLenientFlags(LENIENT_FLAGS.VERSION,
309 {
310 1: node,
311 },
312 this.load('http_major', {
313 0: this.load('http_minor', {
314 9: node,
315 }, errorNode),
316 1: this.load('http_minor', {
317 0: node,
318 1: node,
319 }, errorNode),
320 2: this.load('http_minor', {
321 0: node,
322 }, errorNode),
323 }, errorNode),
324 );
325 };
326
327 const checkIfAllowLFWithoutCR = (success: Node, failure: Node) => {
328 return this.testLenientFlags(LENIENT_FLAGS.OPTIONAL_CR_BEFORE_LF, { 1: success }, failure);

Callers

nothing calls this directly

Calls 2

testLenientFlagsMethod · 0.95
loadMethod · 0.95

Tested by

no test coverage detected