Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit 0dd8032

Browse files
committed
Fix: issues with digest authentication
1 parent 54636d3 commit 0dd8032

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app.fetch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ class SocketFetch extends ArcEventSource {
13201320
} else if (status === 401) {
13211321
if (this._connection.headers.has('www-authenticate')) {
13221322
let authHeader = this._connection.headers.get('www-authenticate');
1323-
if (authHeader.toLowerCase().indexOf('digest')) {
1323+
if (authHeader.toLowerCase().indexOf('digest') !== -1) {
13241324
this.handleDigestResponse(authHeader);
13251325
}
13261326
}
@@ -1376,7 +1376,7 @@ class SocketFetch extends ArcEventSource {
13761376
handleDigestResponse(digestHeaders) {
13771377
digestHeaders = digestHeaders.slice(digestHeaders.indexOf(':') + 1, -1);
13781378
digestHeaders = digestHeaders.split(',');
1379-
this.auth = new DigestAuth();
1379+
this.auth = new DigestAuth({});
13801380
this.auth.method = 'digest';
13811381
this.auth.scheme = digestHeaders[0].split(/\s/)[1];
13821382
for (var i = 0; i < digestHeaders.length; i++) {

auth.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
class FetchAuth {
88
constructor(opts) {
99
// Login to authorize with
10-
this.uid = opts.uid;
10+
this.uid = opts.uid || undefined;
1111
// Password to authorize with
12-
this.passwd = opts.passwd;
12+
this.passwd = opts.passwd || undefined;
1313
// Aythentication method: basic, ntlm, digest (lowercase)
14-
this.method = opts.method;
14+
this.method = opts.method || undefined;
1515
// Optional domain for authentication.
16-
this.domain = opts.domain;
16+
this.domain = opts.domain || undefined;
1717
// If true it is a proxt authorization.
18-
this.proxy = opts.proxy;
18+
this.proxy = opts.proxy || undefined;
1919
}
2020

2121
authenticate() {

0 commit comments

Comments
 (0)