We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aa1156 commit 9e2d0b7Copy full SHA for 9e2d0b7
src/index.js
@@ -167,6 +167,10 @@ function create(defaults) {
167
data = f(data, options.headers) || data;
168
});
169
170
+ if (options.auth) {
171
+ customHeaders.authorization = options.auth;
172
+ }
173
+
174
if (data && typeof data === 'object' && typeof data.append !== 'function' && typeof data.text !== 'function') {
175
data = JSON.stringify(data);
176
customHeaders['content-type'] = 'application/json';
@@ -178,10 +182,6 @@ function create(defaults) {
178
182
);
179
183
} catch (e) {}
180
184
181
- if (options.auth) {
- customHeaders.authorization = options.auth;
- }
-
185
if (options.baseURL) {
186
url = url.replace(/^(?!.*\/\/)\/?/, options.baseURL + '/');
187
}
0 commit comments