http.get Parse Error, code: 'HPE_UNEXPECTED_CONTENT_LENGTH'

后端 未结 2 1389
误落风尘
误落风尘 2021-01-14 11:22

I have a simple node script to process some data from my home automation API. Everything worked fine till last Node update. Now, with Node version 4.3.0 or 5.6.0, the http m

相关标签:
2条回答
  • 2021-01-14 11:35

    As said in the previous answer this is node design as per HTTP standards. i got this issue when I was trying to access REST-API (a content disposition call) in my DEV server from my Angular App running in my local machine. API was not adding these headers Content-Length and Transfer Encoding. The issue resolved when the app was also deployed to Dev server (Angular App and REST API in same server).

    From what I understood, Remove one header if both are being added in API or Try deploying app in Server.

    This is a useful link on this issue - https://github.com/request/request/issues/2091

    0 讨论(0)
  • 2021-01-14 11:40

    I find this commit log. The problem seems is Content-Length and Transfer-encoding: chunked headers exist together:

    the server is sending both a Content-Length header and a Transfer-Encoding: chunked header, which is a violation of the HTTP spec.

    0 讨论(0)
提交回复
热议问题