ijpiantanida / talkback

A simple HTTP proxy that records and playbacks requests
MIT License
284 stars 41 forks source link

Requests fail on Node v15.2.1 #46

Closed halilb closed 3 years ago

halilb commented 3 years ago

Hello,

I've started using Node v15.2.1 with talkback and discovered my simple requests are failing with it.

Here is the stack trace:

Error handling request TypeError: Cannot read property 'content-encoding' of undefined at Function.Headers.read (/Users/halil/thanx/talkback/src/utils/headers.ts:2:434) at ContentEncoding.contentEncoding (/Users/halil/thanx/talkback/src/utils/content-encoding.ts:2:7364) at ContentEncoding.isUncompressed (/Users/halil/thanx/talkback/src/utils/content-encoding.ts:2:6802) at Tape.normalizeBody (/Users/halil/thanx/talkback/src/tape.ts:3:2493) at new Tape (/Users/halil/thanx/talkback/src/tape.ts:3:31) at RequestHandler. (/Users/halil/thanx/talkback/src/request-handler.ts:2:10789) at step (/Users/halil/thanx/talkback/src/request-handler.ts:2:8237) at Object.next (/Users/halil/thanx/talkback/src/request-handler.ts:2:5187) at /Users/halil/thanx/talkback/src/request-handler.ts:2:4300 at new Promise () at awaiter (/Users/halil/thanx/talkback/src/request-handler.ts:2:3473) at RequestHandler.handle (/Users/halil/thanx/talkback/src/request-handler.ts:2:10024) at TalkbackServer. (/Users/halil/thanx/talkback/src/server.ts:3:95) at step (/Users/halil/thanx/talkback/src/server.ts:2:8450) at Object.next (/Users/halil/thanx/talkback/src/server.ts:2:5314) at /Users/halil/thanx/talkback/src/server.ts:2:4406 at new Promise () at awaiter (/Users/halil/thanx/talkback/src/server.ts:2:3561) at IncomingMessage. (/Users/halil/thanx/talkback/src/server.ts:2:10702)

Here is my request in curl format:

curl --request GET \
  --url http://localhost:3000/apps/crew \
  --header 'Content-Type: application/json'

Also, 16 tests are failing in the talkback repository when I run them with Node 15.2.1.

halilb commented 3 years ago

Thank you @ijpiantanida! Could you create a version including this fix?

ijpiantanida commented 3 years ago

Hi @halilb thank you for the patch. I'm working on it, but seems like Travis.ci is having some sort of issue right now and not running the builds.

I will publish a new version as soon as it's back

ijpiantanida commented 3 years ago

Fixed in 2.3.0

halilb commented 3 years ago

Thank you @ijpiantanida!