Skip to content

Commit a267b76

Browse files
committed
Simplified header creation.
1 parent 9203a56 commit a267b76

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/util/request.web.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export default function (baseUrl, options) {
4848
const auth = typeof username === 'string' ? {username, password} : {}
4949

5050
if (auth.username !== undefined && headers['Authorization'] === undefined) {
51-
const btoa = window.btoa ? window.btoa : window.base64.encode
52-
headers['Authorization'] = 'Basic ' + btoa(auth.username + ':' + auth.password)
51+
headers['Authorization'] = 'Basic ' + window.btoa(auth.username + ':' + auth.password)
5352
}
5453

5554
const urlParts = {
@@ -71,7 +70,6 @@ export default function (baseUrl, options) {
7170
const req = xhr({
7271
responseType: 'text',
7372
...options,
74-
...auth,
7573
url: formatUrl(urlParts),
7674
body,
7775
method,

0 commit comments

Comments
 (0)