Skip to content

Commit f49f3b8

Browse files
author
Artur Pryka
committed
Merge branch 'master' into apryka-result-parsers
2 parents b469572 + a302e25 commit f49f3b8

11 files changed

+89
-205
lines changed

dist/keen-analysis.js

+8-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/keen-analysis.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/keen-analysis.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/keen-analysis.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node/keen-analysis.js

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node/keen-analysis.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/request.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ export default function request(method, httpHandlers){
2626
return this;
2727
}
2828

29+
if (requestUrlAndOptions && requestUrlAndOptions.params) {
30+
requestUrlAndOptions.params = mapKeysToUnderscore(requestUrlAndOptions.params);
31+
}
32+
2933
this.config = {
3034
api_key : undefined,
3135
params : {},
3236
method,
3337
headers : {
34-
'Authorization' : requestUrlAndOptions.api_key,
38+
'Authorization' : (requestUrlAndOptions.api_key || requestUrlAndOptions.apiKey),
3539
'Content-type' : 'application/json',
3640
'keen-sdk': `javascript-${version}`
3741
},
@@ -67,7 +71,7 @@ request.prototype.timeout = function(num){
6771
};
6872

6973
request.prototype.send = function(obj){
70-
if (this.config && !this.config.api_key) throw new Error('Please provide valid API key');
74+
if (this.config && !this.config.api_key && !this.config.apiKey) throw new Error('Please provide a valid API key');
7175
if (obj) {
7276
this.config.params = (obj && typeof obj === 'object') ? mapKeysToUnderscore(obj) : {};
7377
}

lib/utils/http-server.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import https from 'https';
22
import url from 'url';
33

4-
import extend from 'keen-core/lib/utils/extend';
54
import serialize from 'keen-core/lib/utils/serialize';
65

76
const handleRequest = (config, args = {}) => {

0 commit comments

Comments
 (0)