question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parse Error: Expected HTTP/

See original GitHub issue

On mockttp 0.20.0, 0.20.1, and 0.20.2 I get a weird http parse error. I think it is something to do with response encoding.

Node version is 12.18.0

tested the request with request-promise, axios, and fetch with the same results each time

{
  "config": {
    "url": "https://localhost:1234/oauth/access_token.php",
    "method": "post",
    "data": {
      "_overheadLength": 432,
      "_valueLength": 150,
      "_valuesToMeasure": [],
      "writable": false,
      "readable": true,
      "dataSize": 0,
      "maxDataSize": 2097152,
      "pauseStreams": true,
      "_released": true,
      "_streams": [],
      "_currentStream": null,
      "_insideLoop": false,
      "_pendingNext": false,
      "_boundary": "--------------------------229731192039541199026626",
      "_events": {},
      "_eventsCount": 1
    },
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": "multipart/form-data; boundary=--------------------------229731192039541199026626",
      "User-Agent": "axios/0.19.2"
    },
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1
  },
  "code": "HPE_INVALID_CONSTANT"
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pimterrycommented, Jun 18, 2020

Great! Thanks for testing that. I’ll put together a proper release in the next day or so, so you can use this for real, watch this space.

0reactions
pimterrycommented, Jun 18, 2020

This was just published as v0.20.3 🎉.

Thanks for reporting this. Hope that sorts things out for you, let me know if you have any other trouble.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse error when no HTTP/ ... in the response message #9176
Below error message from console. "POST http://192.168.225.1/ Error: Parse Error: Expected HTTP/ Request Headers Content-Type: application/json
Read more >
python - Parse Error: The server returned a malformed response
What does Error: Parse Error: Expected HTTP/ mean? I checked my app logs but it seems it is not handling any request, even...
Read more >
Getting Error: "Parse Error: Expected HTTP" - General
Hi, I have a ethernet webrelay (WebRelay | Ethernet Relay | Remote Relay Control) that opens my front door. To open the door...
Read more >
"Error: Parse Error: Expected HTTP/" when using dns
I have a simple http rest api, which works perfectly when using the ip address directly. I made a dns A record (unproxied)...
Read more >
HTTP Request or Response Parse Error | Imperva
HTTP Request or Response Parse Error Summary The SecureSphere HTTP Module could not parse the HTTP Request or response due to malformed format....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found