swiftyper-node 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/SwiftyperResource.js +2 -3
- package/package.json +1 -1
package/lib/SwiftyperResource.js
CHANGED
|
@@ -192,9 +192,8 @@ SwiftyperResource.prototype = {
|
|
|
192
192
|
: this._swiftyper.getMaxNetworkRetries();
|
|
193
193
|
},
|
|
194
194
|
|
|
195
|
-
_makeHeaders(
|
|
195
|
+
_makeHeaders(contentLength, method, userSuppliedHeaders) {
|
|
196
196
|
const defaultHeaders = {
|
|
197
|
-
'X-Swiftyper-API-Key': auth || this._swiftyper.getApiField('auth'),
|
|
198
197
|
Accept: 'application/json',
|
|
199
198
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
200
199
|
'Content-Length': contentLength,
|
|
@@ -210,6 +209,7 @@ SwiftyperResource.prototype = {
|
|
|
210
209
|
let requestData;
|
|
211
210
|
|
|
212
211
|
data.__req = requests++;
|
|
212
|
+
data.api_key = auth ? auth : this._swiftyper.getApiField('auth');
|
|
213
213
|
|
|
214
214
|
const retryRequest = (requestFn, headers, requestRetries, retryAfter) => {
|
|
215
215
|
return setTimeout(
|
|
@@ -313,7 +313,6 @@ SwiftyperResource.prototype = {
|
|
|
313
313
|
requestData = data;
|
|
314
314
|
|
|
315
315
|
const headers = this._makeHeaders(
|
|
316
|
-
auth,
|
|
317
316
|
requestData.length,
|
|
318
317
|
method,
|
|
319
318
|
options.headers,
|