Permalink
Browse files

Merge branch 'lazutkin-master'

  • Loading branch information...
mansilladev committed Jun 6, 2014
2 parents 4ffb2aa + 9eacc5c commit ab7017c5a29a8c3c64a2af656f2939afa02e63f0
Showing with 4 additions and 1 deletion.
  1. +4 −1 app.js
View
5 app.js
@@ -295,7 +295,10 @@ function oauth2(req, res, next){
var encoded_basic = new Buffer(basic_cred).toString('base64');
var http_method = (apiConfig.oauth2.authorizationHeader == 'Y') ? "POST" : "GET";
- var header = (apiConfig.oauth2.authorizationHeader == 'Y') ? {'Authorization' : 'Basic ' + encoded_basic} : '';
+ var header = { 'Content-Type': 'application/x-www-form-urlencoded' };
+ if ( apiConfig.oauth2.authorizationHeader == 'Y' ) {
+ header[ 'Authorization' ] = 'Basic ' + encoded_basic;
+ }
var fillerpost = query.stringify({grant_type : "client_credentials", client_id : apiKey, client_secret : apiSecret});
db.set(key + ':apiKey', apiKey, redis.print);

0 comments on commit ab7017c

Please sign in to comment.