william-os4y / fapws3

Fast Asynchronous Python Web Server (based on libev)
GNU General Public License v2.0
341 stars 38 forks source link

Content-Length 0 _should_ be allowed #6

Closed mcav closed 14 years ago

mcav commented 14 years ago

According to the HTTP 1.1 spec:

Any Content-Length greater than or equal to zero is a valid value. Section 4.4 describes how to determine the length of a message-body if a Content-Length is not given.

I have some REST-style APIs that use POST requests with 0 content-length, so I think there's real practical value in allowing 0-length POST requests. Since the HTTP spec says it should be allowed, I think we should try to make FAPWS allow that as well.

william-os4y commented 14 years ago

OK. I was not aware of that. To validate the code modif, could you provide a sample of such request ?

william-os4y commented 14 years ago

code adapted.

Thanks