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.

Invalid body doesn't error

See original GitHub issue
test('https://github.com/mcollina/undici/issues/807', (t) => {
  t.plan(2)

  const server = net.createServer(socket => {
    socket.write('HTTP/1.1 200 OK\r\n')
    socket.write('Content-Length: 1\r\n\r\n')
    socket.write('11111\r\n')
  })
  t.teardown(server.close.bind(server))

  server.listen(0, () => {
    const client = new Client(`http://localhost:${server.address().port}`)
    t.teardown(client.destroy.bind(client))

    client.request({
      path: '/',
      method: 'GET'
    }, (err, data) => {
      t.error(err)
      data.body.resume().on('end', () => {
        t.fail()
      })
    })
  })
})

I think the above request should fail. The body is longer than content-length.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:26 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
ronagcommented, May 25, 2021

I haven’t forgotten and will get to this as soon as I can.

1reaction
ronagcommented, May 18, 2021

Yea. I think you might be right. I’ll open a Pr.

how are you doing?

I’ve been working non stop with deploying a new system into production. I think I can have a PR by end of week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

“Invalid Body” error in sign in page : r/help - Reddit
I'm trying to log in through the browser using Google Sign In, and I keep getting the error “Invalid Body”, would anyone know...
Read more >
HTTP Return Code for "Invalid" Body - Stack Overflow
Let's say I have a REST POST end-point: www.foo.com/validate/X where X represents a number. My server-side pseudocode looks like this:
Read more >
Discord Invalid Form Body - Code Help - Glitch Support
My code worked before, and now it shows the error “DiscordAPIError: Invalid Form Body, type: Value “{u'type': u'text'}” is not int.” Do you...
Read more >
Error and Warning Dictionary | Twilio
Explore the full list of all possible Twilio REST API error codes. ... WARNING. Dial: Twilio does not support calling this number or...
Read more >
discord api error invalid form body - You.com | The AI Search ...
The Discord API Error: Invalid Form Body means that the body of the API request is not formatted correctly or is missing critical...
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