Added tests for 302 redirect functionality

This commit is contained in:
ciaranj
2011-04-19 23:09:20 +01:00
parent 8050d82019
commit 9fea0b5458
4 changed files with 106 additions and 3 deletions

View File

@ -310,7 +310,7 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
response.on('end', function () {
if( response.statusCode != 200 ) {
// Follow 302 redirects with Location HTTP header
if(response.statusCode == 302 && response.headers.location) {
if(response.statusCode == 302 && response.headers && response.headers.location) {
self._performSecureRequest( oauth_token, oauth_token_secret, method, response.headers.location, extra_params, post_body, post_content_type, callback);
}
else {