Skip to content

Commit 1bc2a1b

Browse files
committed
Fix for changing options or headers during retry
1 parent 3b150e8 commit 1bc2a1b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ export default class API {
5050
const placeholders = args.placeholders || {};
5151
const options = args.options || {};
5252

53-
const augmentedOptions = {
54-
...options,
55-
headers: this.config.configureHeaders({
56-
'Content-Type': 'appication/json',
57-
Accept: 'application/json',
58-
...options.headers
59-
})
60-
};
61-
6253
const missingPlaceholders = requiredPlaceholders.filter(name => !placeholders[name]);
6354
if(missingPlaceholders.length) {
6455
console.error(`The ${name} API call cannot be performed. The following params were not specified: ${missingPlaceholders.join(', ')}`);
@@ -75,6 +66,15 @@ export default class API {
7566
}
7667

7768
const createRequest = () => {
69+
const augmentedOptions = {
70+
...options,
71+
headers: this.config.configureHeaders({
72+
'Content-Type': 'appication/json',
73+
Accept: 'application/json',
74+
...options.headers
75+
})
76+
};
77+
7878
const opts = this.config.configureOptions(augmentedOptions);
7979
const reqPath = applyUrlWithPlaceholders(path, placeholders);
8080
let baseUrl = this.config.baseUrl;

0 commit comments

Comments
 (0)