Permalink
Browse files

Manual merge branch 'master' of https://github.com/lazutkin/iodocs in…

…to lazutkin-master

Conflicts:
	app.js
  • Loading branch information...
2 parents 4ffb2aa + 7ad9f4d commit 9eacc5c57ca056fbce1ccfb050e9344b11fc1e46 @mansilladev mansilladev committed Jun 6, 2014
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 9eacc5c

Please sign in to comment.