Skip to content

Commit da0f943

Browse files
committed
fix(action): remove default api vesrion header
1 parent 1fafe92 commit da0f943

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

lib/action.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ const request = require('./request');
22
const { sign } = require('./signing');
33
const ClientError = require('./error');
44

5-
// This doesn't really make sense anymore as the version won't change (0.0.0-development)
6-
// We should probably read the tags and use the latest one as version.
7-
function getDefaultHeaders(version) {
8-
return {
9-
'x-ub-api-client': `Usabilla API Node Client/${version}`
10-
};
11-
}
12-
135
function performRequest(requestOptions, accessKey, privateKey, options, items) {
146
const signature = sign(
157
accessKey,
@@ -67,7 +59,7 @@ function action(
6759
iterator: apiOptions.iterator,
6860
method: endpointOptions.method,
6961
path: endpointOptions.path,
70-
headers: getDefaultHeaders(process.env.VERSION)
62+
headers: {}
7163
};
7264

7365
return performRequest(requestOptions, accessKey, privateKey, options, []);

test/actions.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ describe('action', () => {
2424
baseURL: 'https://localhost',
2525
headers: {
2626
Authorization:
27-
'USBL1-HMAC-SHA256 Credential=access-key/20160101/usbl1_request, SignedHeaders=host;x-ub-api-client;x-usbl-date, Signature=7f71ccd5a740b72a229f8f6aee0b738b9b4f1e5106efe51da785fa3574116f9b',
27+
'USBL1-HMAC-SHA256 Credential=access-key/20160101/usbl1_request, SignedHeaders=host;x-usbl-date, Signature=bdbf025412de09a0331ee3810533f7c69146413745da0412a8d2a71a7d2ba0ce',
2828
host: 'data.usabilla.com',
29-
'x-ub-api-client': 'Usabilla API Node Client/undefined',
3029
'x-usbl-date': '20160101T000000Z'
3130
},
3231
method: 'get',

webpack.config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
const path = require('path');
2-
const webpack = require('webpack');
3-
const packageJson = require('./package.json');
42

53
module.exports = {
64
entry: './lib/index.js',
@@ -20,10 +18,5 @@ module.exports = {
2018
use: 'babel-loader'
2119
}
2220
]
23-
},
24-
plugins: [
25-
new webpack.DefinePlugin({
26-
'process.env.VERSION': JSON.stringify(packageJson.version)
27-
})
28-
]
21+
}
2922
};

0 commit comments

Comments
 (0)