creationix/http-parser-js

TypeError: parser.free is not a function

AntonShevel opened this issue · 1 comments

I try to deal with HPE_INVALID_HEADER_TOKEN Parse Error.
That's why I tried to use http-parser-js
Unfortunately after enable http-parser-js with following code

process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser;

I receive

_http_common.js:219
      parser.free();
             ^

TypeError: parser.free is not a function
    at freeParser (_http_common.js:219:14)
    at Socket.socketOnData (_http_client.js:483:5)
    at Socket.emit (events.js:160:13)
    at addChunk (_stream_readable.js:269:12)
    at readableAddChunk (_stream_readable.js:256:11)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onread (net.js:599:20)

Nodejs version - 9.4.0

npm ls http-parser-js
home-monit@0.0.1 /Users/zerg/Work/home-monit
└── http-parser-js@0.4.9 

Thanks for reporting! Fix for this has been published to NPM as v0.4.10