Skip to content
Myr

Fix the comment too.

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

If content-type is multipart/form-data, keep the header.

authored by ayanamist · committed by ayanamist · parent 8a1d53e · Browse files · 1 file+1 added−2 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+1 added−2 removed

  • other:+1 added−2 removed

1 file+1 added−2 removed

modified:requests/auth.py+1 added-2 removed
83 unmodified lines
84 # extract_params can only check the present r.data and does not know85 # of r.files, thus an extra check is performed. We know that86 # if files are present the request will not have87 # Content-type: x-www-form-urlencoded. We guess it will have88 # a mimetype of multipart/form-encoded and if this is not the case88 # a mimetype of multipart/form-data and if this is not the case89 # we assume the correct header will be set later.90 _cond = True91 if r.files and contenttype == CONTENT_TYPE_MULTI_PART:92 # Omit body data in the signing and since it will always93 # be empty (cant add paras to body if multipart) and we wish94 # to preserve body.95 r.headers['Content-Type'] = CONTENT_TYPE_MULTI_PART95 r.url, r.headers, _ = self.client.sign(96 unicode(r.full_url), unicode(r.method), None, r.headers)97 elif decoded_body != None and contenttype in (CONTENT_TYPE_FORM_URLENCODED, ''):98 # Normal signing
283 unmodified lines