twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
73 stars 6 forks source link

POST /helix/chat/messages wrong error code for message too large #904

Open NateBrady23 opened 8 months ago

NateBrady23 commented 8 months ago

Brief description

Troubleshooting an issue locally, I kept getting:

{
  "error": "Bad Request",
  "status": 400,
  "message": "The request's input was not valid. Please see the endpoint's documentation for possible reasons."
}

After some testing generating lorem ipsum text, this was only happening with messages larger than 500 characters.

According to the documentation, this should be a 422 error.

How to reproduce

Here's a message with 500 characters that works:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus in vestibulum est. Nulla sed scelerisque augue, ac venenatis nisl. Fusce rutrum cursus nibh sed iaculis. Cras sed ex id est tempus iaculis. Aenean et libero ullamcorper, facilisis metus id, tristique libero. Cras sem risus, euismod bibendum nunc vel, scelerisque eleifend mauris. Vestibulum at tortor at sapien pulvinar cursus ac vel nunc. Cras sed eros vel tellus dignissim vestibulum. In hac habitasse platea dictumst. Cras id metus.

Adding 1 character to that message will cause the 400 error.