Skip to content
This repository was archived by the owner on Jul 6, 2018. It is now read-only.
This repository was archived by the owner on Jul 6, 2018. It is now read-only.

http2: get path throws #76

Description

@robertkowalski

To me it looks getting the path and/or headers is broken:

internal/http2/compat.js:253
    return headers.get(constants.HTTP2_HEADER_PATH);
                  ^

TypeError: Cannot read property 'get' of undefined
    at Http2ServerRequest.get path [as path] (internal/http2/compat.js:253:19)
    at Http2Server.http2.createServer (/Users/robert/projects/http2/test/parallel/test-http2-set-cookies.js:31:18)
    at emitTwo (events.js:125:13)
    at Http2Server.emit (events.js:213:7)
    at Http2Server.onServerStream (internal/http2/compat.js:501:10)
    at emitThree (events.js:135:13)
    at Http2Server.emit (events.js:216:7)
    at Http2Session.sessionOnStream (internal/http2/core.js:1035:10)
    at emitThree (events.js:135:13)
    at Http2Session.emit (events.js:216:7)

still haven't found out if the client doesn't send a path in general or if the issue is on the server side

'use strict';
require('../common');
const assert = require('assert');
const http2 = require('http2');

const server = http2.createServer((req, res) => {
  console.log(req.path)
});
server.listen(0);

server.on('listening', function() {
  const client = http2.connect(`http://localhost:${this.address().port}`);

  const headers = { ':path': '/' };
  const req = client.request(headers).setEncoding('utf8');
});

process.on('exit', function() {
  assert.strictEqual(2, nresponses);
});

depends on #75 -- without #75 a request crashes with:

internal/http2/compat.js:282
    this[kHeaders] = linkedList.create();
                                ^

TypeError: linkedList.create is not a function
    at new Http2ServerResponse (internal/http2/compat.js:282:33)
    at Http2Server.onServerStream (internal/http2/compat.js:456:5)
    at emitThree (events.js:135:13)
    at Http2Server.emit (events.js:216:7)
    at Http2Session.sessionOnStream (internal/http2/core.js:1035:10)
    at emitThree (events.js:135:13)
    at Http2Session.emit (events.js:216:7)
    at Http2Session.onSessionHeaders [as onheaders] (internal/http2/core.js:104:11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions