Skip to content

Commit 9e2d0b7

Browse files
committed
gzip is fun
1 parent 7aa1156 commit 9e2d0b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ function create(defaults) {
167167
data = f(data, options.headers) || data;
168168
});
169169

170+
if (options.auth) {
171+
customHeaders.authorization = options.auth;
172+
}
173+
170174
if (data && typeof data === 'object' && typeof data.append !== 'function' && typeof data.text !== 'function') {
171175
data = JSON.stringify(data);
172176
customHeaders['content-type'] = 'application/json';
@@ -178,10 +182,6 @@ function create(defaults) {
178182
);
179183
} catch (e) {}
180184

181-
if (options.auth) {
182-
customHeaders.authorization = options.auth;
183-
}
184-
185185
if (options.baseURL) {
186186
url = url.replace(/^(?!.*\/\/)\/?/, options.baseURL + '/');
187187
}

0 commit comments

Comments
 (0)