digest-fetch
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -42,3 +42,3 @@ /// !----------------------------------------------------------------------------------------------------------- | ||
// https://stackoverflow.com/questions/9859627/how-to-prevent-browser-to-invoke-basic-auth-popup-and-handle-401-error-using-jqu | ||
this.statusCode = options.statusCode || 401 | ||
this.statusCode = options.statusCode | ||
this.basic = options.basic || false | ||
@@ -50,3 +50,3 @@ } | ||
const resp = await fetch(url, this.addAuth(url, options)) | ||
if (resp.status == this.statusCode) { | ||
if (resp.status == 401 || (resp.status == this.statusCode && this.statusCode)) { | ||
this.hasAuth = false | ||
@@ -56,3 +56,3 @@ await this.parseAuth(resp.headers.get('www-authenticate')) | ||
const respFinal = await fetch(url, this.addAuth(url, options)) | ||
if (respFinal.status == this.statusCode) { | ||
if (respFinal.status == 401 || respFinal.status == this.statusCode) { | ||
this.hasAuth = false | ||
@@ -59,0 +59,0 @@ } else { |
{ | ||
"name": "digest-fetch", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "digest auth request plugin for fetch/node-fetch also support http basic auth authentication", | ||
@@ -5,0 +5,0 @@ "main": "digest-fetch-src.js", |
@@ -60,3 +60,3 @@ # digest-fetch | ||
| algorithm | string | 'MD5' | algorithm to be used: 'MD5' or 'MD5-sess' | | ||
| statusCode | number | 401 | custom authentication failure code for avoiding browser prompt, see details below | | ||
| statusCode | number | 401 | custom alternate authentication failure code for avoiding browser prompt, see details below | | ||
| cnonceSize | number | 32 | length of the cnonce | | ||
@@ -63,0 +63,0 @@ | logger | object | none | logger for debug, can use `console`, default no logging | |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131638