Message236840
> The logic now is as it was before, except that we set a content length of zero if the body is None and the method is one of OPTIONS, PATCH, PUT, or POST.
I see we definitely have similar thinking on the modifications required for this, but I don’t think I’m in favour of the approach in the patch. Consider the case where you have a GET request without a body. Now, instead of simply circumventing the _set_content_length method altogether as would have been done previously, the code path will now go into _set_content_length, have a TypeError exception raised on (str(len([None])) and then an AttributeError exception raised on os.fstat([None].fileno()). That seems to be quite a bit of additional overhead when it could be avoided altogether by an earlier check as I have in my example.
What do you think? |
|
Date |
User |
Action |
Args |
2015-02-27 21:11:37 | demian.brecht | set | recipients:
+ demian.brecht, jimr |
2015-02-27 21:11:37 | demian.brecht | link | issue23539 messages |
2015-02-27 21:11:36 | demian.brecht | create | |
|