Skip to content

Commit 4e2dda0

Browse files
committed
Revert "Allows custom sdk header"
This reverts commit 05dd822.
1 parent 05dd822 commit 4e2dda0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/gn-auth.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
var request = require('request');
44
var q = require('q');
5+
var sdkPackage = require('../package.json');
56

67
function GnAuth(options, constants) {
78
this.constants = constants;
89
this.clientId = options.client_id;
910
this.clientSecret = options.client_secret;
1011
this.baseUrl = options.baseUrl;
11-
this.sdkHeader = options.sdkHeader;
1212
}
1313

1414
GnAuth.prototype.getAccessToken = function() {
@@ -18,7 +18,7 @@ GnAuth.prototype.getAccessToken = function() {
1818
url: this.baseUrl + this.constants.ENDPOINTS.authorize.route,
1919
json: true,
2020
headers: {
21-
'api-sdk': this.sdkHeader
21+
'api-sdk': 'node-' + sdkPackage.version
2222
},
2323
body: {
2424
grant_type: 'client_credentials'

lib/gn-endpoints.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ var sdkPackage = require('../package.json');
77

88
function GnEndpoints(options, constants) {
99
options.baseUrl = options.sandbox ? constants.URL.sandbox : constants.URL.production;
10-
if (!options.sdkHeader) {
11-
options.sdkHeader = 'node-' + sdkPackage.version;
12-
}
1310
this.options = options;
1411
this.gnAuth = new GnAuth(options, constants);
1512
this.accessToken = null;
@@ -107,7 +104,7 @@ GnEndpoints.prototype.getParams = function(route) {
107104
url: [this.options.baseUrl, route, query].join(''),
108105
json: true,
109106
headers: {
110-
'api-sdk': self.options.sdkHeader
107+
'api-sdk': 'node-' + sdkPackage.version
111108
},
112109
body: this.body
113110
};

0 commit comments

Comments
 (0)