http-auth
Advanced tools
Comparing version 4.1.9 to 4.2.0
{ | ||
"name": "http-auth", | ||
"description": "Node.js package for HTTP basic and digest access authentication.", | ||
"version": "4.1.9", | ||
"version": "4.2.0", | ||
"author": "Gevorg Harutyunyan (http://github.com/gevorg)", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
@@ -53,2 +53,3 @@ # http-auth | ||
- Line format is **{user:realm:passHash}** for digest access. | ||
- Using a callback, it needs to return the same line format, example: `file: () => 'adam:adam\neve:eve',` | ||
- `algorithm` - Algorithm that will be used only for **digest** access authentication. | ||
@@ -55,0 +56,0 @@ - **MD5** by default. |
@@ -146,8 +146,9 @@ "use strict"; | ||
// Loading files with user details. | ||
// Loading files or using a callback with user details. | ||
loadUsers() { | ||
let users = fs | ||
.readFileSync(this.options.file, "UTF-8") | ||
.replace(/\r\n/g, "\n") | ||
.split("\n"); | ||
let content = | ||
typeof this.options.file == "function" | ||
? this.options.file(this) | ||
: fs.readFileSync(this.options.file, "UTF-8"); | ||
let users = content.replace(/\r\n/g, "\n").split("\n"); | ||
@@ -154,0 +155,0 @@ // Process all users. |
17885
445
89