django / asgiref

ASGI specification and utilities
https://asgi.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.46k stars 207 forks source link

Is the server in charge of making sure the `Content-Length` matches the body? #422

Closed Kludex closed 8 months ago

Kludex commented 9 months ago

Currently, the server makes sure the Content-Length header is correct, or it raises an error, but it's not specified in the spec.

Should it be?

andrewgodwin commented 9 months ago

You say "the server" - which server? I don't think verifying content-length needs to be in the spec, but it's probably fine if a server wants to make its users' lives easier via some checks,