From 05de270d7a074999ef3c58fede2b4fae7433aeaf Mon Sep 17 00:00:00 2001 From: Ib Lundgren Date: Wed, 19 Dec 2012 21:30:11 +0100 Subject: [PATCH] Why auth must be prepared last --- requests/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requests/models.py b/requests/models.py index a7009eb..59f8ad4 100644 --- a/requests/models.py +++ b/requests/models.py @@ -195,6 +195,8 @@ class Request(RequestHooksMixin): p.prepare_headers(self.headers) p.prepare_cookies(self.cookies) p.prepare_body(self.data, self.files) + # Note that prepare_auth most be last to enable authentication schemes + # such as OAuth to work on a fully prepared request. p.prepare_auth(self.auth) return p -- 2.7.4