digest-fetch
Advanced tools
Comparing version
@@ -9,4 +9,3 @@ /// !----------------------------------------------------------------------------------------------------------- | ||
if (typeof(fetch) !== 'function' && canRequire) var fetch = require('node-fetch') | ||
// if (typeof(cryptojs) !== 'function' && canRequire) var cryptojs = require('crypto-js') | ||
const cryptojs = require('crypto-js') | ||
const md5 = require('md5') | ||
const base64 = require('base-64') | ||
@@ -87,3 +86,3 @@ | ||
static computeHash(user, realm, password) { | ||
return cryptojs.MD5(`${user}:${realm}:${password}`).toString(); | ||
return md5(`${user}:${realm}:${password}`); | ||
} | ||
@@ -104,3 +103,3 @@ | ||
if (this.digest.algorithm === 'MD5-sess') { | ||
ha1 = cryptojs.MD5(`${ha1}:${this.digest.nonce}:${this.digest.cnonce}`).toString() | ||
ha1 = md5(`${ha1}:${this.digest.nonce}:${this.digest.cnonce}`); | ||
} | ||
@@ -114,5 +113,5 @@ | ||
// const entityBody = xxx | ||
// _ha2 = ':' + cryptojs.MD5(entityBody).toString() | ||
// _ha2 = ':' + md5(entityBody) | ||
} | ||
const ha2 = cryptojs.MD5(`${method}:${uri}${_ha2}`).toString() | ||
const ha2 = md5(`${method}:${uri}${_ha2}`); | ||
@@ -123,3 +122,3 @@ const ncString = ('00000000'+this.digest.nc).slice(-8) | ||
if (!this.digest.qop) _response = `${ha1}:${this.digest.nonce}:${ha2}` | ||
const response = cryptojs.MD5(_response).toString() | ||
const response = md5(_response); | ||
@@ -126,0 +125,0 @@ const opaqueString = this.digest.opaque !== null ? `opaque="${this.digest.opaque}",` : '' |
{ | ||
"name": "digest-fetch", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "digest auth request plugin for fetch/node-fetch also support http basic auth authentication", | ||
@@ -29,11 +29,10 @@ "main": "digest-fetch-src.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.4.5", | ||
"@babel/preset-env": "^7.4.5", | ||
"@babel/core": "^7.14.3", | ||
"@babel/preset-env": "^7.14.2", | ||
"after": "^0.8.2", | ||
"babel-loader": "^8.0.4", | ||
"babel-loader": "^8.2.2", | ||
"babel-polyfill": "^6.26.0", | ||
"chai": "^4.2.0", | ||
"chai-http": "^4.3.0", | ||
"eslint": "^5.9.0", | ||
"eslint-plugin-markdown": "^1.0.0-rc.0", | ||
"eslint": "^7.26.0", | ||
"express": "^4.17.1", | ||
@@ -46,3 +45,2 @@ "istanbul": "^1.1.0-alpha.1", | ||
"serialize-javascript": "^3.1.0", | ||
"terser-webpack-plugin": "^2.2.2", | ||
"webpack": "^4.26.1", | ||
@@ -54,4 +52,4 @@ "webpack-cli": "^3.1.2" | ||
"base-64": "^0.1.0", | ||
"crypto-js": "^3.1.9-1" | ||
"md5": "^2.3.0" | ||
} | ||
} |
@@ -98,2 +98,3 @@ # digest-fetch | ||
Please open issues if you find bugs or meet problems during using this plugin. | ||
Feel free to open PRs whenever you have better ideas on this project! | ||
@@ -100,0 +101,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
17
-10.53%110
0.92%131428
-25.83%823
-11.12%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed