Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit 2745c13

Browse files
author
Rob Griffiths
committed
Move GET param handling to before the content type check.
Thanks to Erick Tai and the StackMob team
1 parent c8e8c7e commit 2745c13

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/OAuth/Consumer.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,18 @@
172172

173173
signatureMethod = oauth.signatureMethod;
174174

175+
// Handle GET params first
176+
params = url.query.toObject();
177+
for (i in params) {
178+
signatureData[i] = params[i];
179+
}
180+
175181
// According to the OAuth spec
176182
// if data is transfered using
177183
// multipart the POST data doesn't
178184
// have to be signed:
179185
// http://www.mail-archive.com/[email protected]/msg01556.html
180186
if((!('Content-Type' in headers) || headers['Content-Type'] == 'application/x-www-form-urlencoded') && !withFile) {
181-
params = url.query.toObject();
182-
for (i in params) {
183-
signatureData[i] = params[i];
184-
}
185187
for (i in data) {
186188
signatureData[i] = data[i];
187189
}
@@ -198,9 +200,9 @@
198200
{
199201
headerParams['realm'] = this.realm;
200202
}
201-
203+
202204
if (oauth.proxyUrl) {
203-
url = URI(oauth.proxyUrl + url.path);
205+
url = URI(oauth.proxyUrl + url.path);
204206
}
205207

206208
if(appendQueryString || method == 'GET') {

0 commit comments

Comments
 (0)