laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
942 stars 63 forks source link

Compare content-length to the length of the request body #188

Closed stephenfrank closed 2 months ago

stephenfrank commented 2 months ago

Content-Length should be compared to the length of the request body otherwise bufferLength() includes the length of the headers and body

joedixon commented 2 months ago

I've tested this locally and, although I can't replicate the issue as I my requests are never never chunked, it does seem to resolve the issue if/when that does occur.

In short, our current check to determine whether the request size matches the expected content-length includes all headers rather than just the body.