Skip to content

Commit e4c006b

Browse files
author
leah.culver
committed
python lib: fix for #16, applied patch plaintext.signature.ampersand.diff. Thanks atregoubenko!
git-svn-id: https://oauth.googlecode.com/svn/code/python@588 f7ae4463-c52f-0410-a7dc-93bad6e629e8
1 parent a713147 commit e4c006b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

oauth/oauth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def to_header(self, realm=''):
124124
# add the oauth parameters
125125
if self.parameters:
126126
for k, v in self.parameters.iteritems():
127-
auth_header += ', %s="%s"' % (k, v)
127+
auth_header += ', %s="%s"' % (k, escape(str(v)))
128128
return {'Authorization': auth_header}
129129

130130
# serialize as post data for a POST request
@@ -512,9 +512,9 @@ def get_name(self):
512512

513513
def build_signature_base_string(self, oauth_request, consumer, token):
514514
# concatenate the consumer key and secret
515-
sig = escape(consumer.secret)
515+
sig = escape(consumer.secret) + '&'
516516
if token:
517-
sig = '&'.join((sig, escape(token.secret)))
517+
sig = sig + escape(token.secret)
518518
return sig
519519

520520
def build_signature(self, oauth_request, consumer, token):

0 commit comments

Comments
 (0)