Skip to content

Commit ced0c3f

Browse files
author
leah.culver
committed
Nicer way to manipulate the OAuth header. Thanks Toby White.
git-svn-id: https://oauth.googlecode.com/svn/code/python@1068 f7ae4463-c52f-0410-a7dc-93bad6e629e8
1 parent b7bd7c9 commit ced0c3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth/oauth.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ def from_request(http_method, http_url, headers=None, parameters=None,
231231
if headers and 'Authorization' in headers:
232232
auth_header = headers['Authorization']
233233
# Check that the authorization header is OAuth.
234-
if auth_header.index('OAuth') > -1:
235-
auth_header = auth_header.lstrip('OAuth ')
234+
if auth_header[:6] == 'OAuth ':
235+
auth_header = auth_header[6:]
236236
try:
237237
# Get the parameters from the header.
238238
header_params = OAuthRequest._split_header(auth_header)

0 commit comments

Comments
 (0)