Skip to content
Myr

Revert "Call auth callable before encoding body data"

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

This reverts commit 9217a2523d7d4fafeebb259884276fc349a376b1.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 748c65f · Browse files · 1 file+16 added−15 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+16 added−15 removed

  • other:+16 added−15 removed

1 file+16 added−15 removed

modified:requests/models.py+16 added-15 removed
479 unmodified lines
480 # Nottin' on you.481 body = None482 content_type = None483484 # Multi-part file uploads.485 if self.files:486 (body, content_type) = self._enc_files487 else:488 if self.data:489490 body = self._enc_data491 if isinstance(self.data, str):492 content_type = None493 else:494 content_type = 'application/x-www-form-urlencoded'495496 # Add content-type if it wasn't explicitly provided.497 if (content_type) and (not 'content-type' in self.headers):498 self.headers['Content-Type'] = content_type499500 # Use .netrc auth if none was provided.501 if not self.auth and self.config.get('trust_env'):502 self.auth = get_netrc_auth(url)503
7 unmodified lines
511512 # Update self to reflect the auth changes.513 self.__dict__.update(r.__dict__)514499 # Multi-part file uploads.500 if self.files:501 (body, content_type) = self._enc_files502 else:503 if self.data:504 body_params, body = self._encode_params(self.data)505 if isinstance(body_params, list) and isinstance(body, str):506 content_type = 'application/x-www-form-urlencoded'507 else:508 content_type = None509510 # Add content-type if it wasn't explicitly provided.511 if (content_type) and (not 'content-type' in self.headers):512 self.headers['Content-Type'] = content_type513515 _p = urlparse(url)516 proxy = self.proxies.get(_p.scheme)517518 if proxy:
333 unmodified lines