Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'lazutkin-master'

  • Loading branch information...
commit ab7017c5a29a8c3c64a2af656f2939afa02e63f0 2 parents 4ffb2aa + 9eacc5c
@mansilladev mansilladev authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.