Skip to content
Myr

Set 'Transfer-Encoding: chunked' if data file length equals 0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Braulio Valdivielso Martínez · committed by Braulio Valdivielso Martínez · parent 6506dc8 · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:requests/models.py+2 added
444 unmodified lines
445 else:446 if data:447 body = self._encode_params(data)448 if isinstance(data, basestring) or hasattr(data, 'read'):449 if hasattr(data, 'fileno') and length == 0:450 self.headers['Transfer-Encoding'] = 'chunked'451 content_type = None452 else:453 content_type = 'application/x-www-form-urlencoded'454
396 unmodified lines