Merge pull request #114 from rolandboon/master
Fix requests containing !'()* in POST data
This commit is contained in:
commit
45a983e6dc
@ -327,7 +327,13 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( (method == "POST" || method == "PUT") && ( post_body == null && extra_params != null) ) {
|
if( (method == "POST" || method == "PUT") && ( post_body == null && extra_params != null) ) {
|
||||||
post_body= querystring.stringify(extra_params);
|
// Fix the mismatch between the output of querystring.stringify() and this._encodeData()
|
||||||
|
post_body= querystring.stringify(extra_params)
|
||||||
|
.replace(/\!/g, "%21")
|
||||||
|
.replace(/\'/g, "%27")
|
||||||
|
.replace(/\(/g, "%28")
|
||||||
|
.replace(/\)/g, "%29")
|
||||||
|
.replace(/\*/g, "%2A");
|
||||||
}
|
}
|
||||||
|
|
||||||
headers["Content-length"]= post_body ? Buffer.byteLength(post_body) : 0;
|
headers["Content-length"]= post_body ? Buffer.byteLength(post_body) : 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user