Comparing version 16.0.4 to 16.0.5
@@ -16,3 +16,3 @@ "use strict"; | ||
class Woodland extends EventEmitter { | ||
constructor ({autoindex = false, cacheSize = 1e3, cacheTTL = 3e5, charset = "utf-8", defaultHeaders = {}, digit = 3, etags = true, indexes = ["index.htm", "index.html"], logging = {}, origins = ["*"], time = false, seed = 42} = {}) { | ||
constructor ({autoindex = false, cacheSize = 1e3, cacheTTL = 3e5, charset = "utf-8", defaultHeaders = {}, digit = 3, etags = true, indexes = ["index.htm", "index.html"], logging = {}, origins = ["*"], seed = 42, sendError = false, time = false} = {}) { | ||
super(); | ||
@@ -36,2 +36,3 @@ this.autoindex = autoindex; | ||
this.origins = JSON.parse(JSON.stringify(origins)); | ||
this.sendError = sendError; | ||
this.time = time; | ||
@@ -222,3 +223,3 @@ | ||
status = isNaN(res.statusCode) === false && res.statusCode >= 400 ? res.statusCode : numeric ? Number(err.message) : 500, | ||
output = numeric ? http.STATUS_CODES[status] : err.message; | ||
output = this.sendError === false ? numeric ? http.STATUS_CODES[status] : err.message : err; | ||
@@ -225,0 +226,0 @@ if (status === 404) { |
{ | ||
"name": "woodland", | ||
"version": "16.0.4", | ||
"version": "16.0.5", | ||
"description": "Lightweight HTTP router with automatic headers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -117,2 +117,3 @@ <img src="https://avoidwork.github.io/woodland/logo.svg" width="108" /> | ||
"seed": 42, | ||
"sendError": false, | ||
"time": false | ||
@@ -174,6 +175,6 @@ } | ||
---------------|---------|----------|---------|---------|--------------------------------------------------------------------------------- | ||
All files | 91.95 | 72.6 | 95.38 | 92.21 | | ||
All files | 91.97 | 72.7 | 95.38 | 92.23 | | ||
woodland | 100 | 100 | 100 | 100 | | ||
index.js | 100 | 100 | 100 | 100 | | ||
woodland/lib | 91.83 | 72.6 | 95.31 | 92.09 | | ||
woodland/lib | 91.85 | 72.7 | 95.31 | 92.11 | | ||
autoindex.js | 100 | 0 | 100 | 100 | 7 | ||
@@ -183,3 +184,3 @@ constants.js | 100 | 100 | 100 | 100 | | ||
utility.js | 91.89 | 73.39 | 100 | 91.82 | 22,143-145,160-161,163,167,185 | ||
woodland.js | 91.24 | 73.31 | 92.86 | 91.67 | 140,152-153,171-172,228-229,238,269-273,288,295,405,419,428-429,436,442,472,476 | ||
woodland.js | 91.27 | 73.44 | 92.86 | 91.7 | 141,153-154,172-173,228-229,239,270-274,289,296,406,420,429-430,437,443,473,477 | ||
---------------|---------|----------|---------|---------|--------------------------------------------------------------------------------- | ||
@@ -186,0 +187,0 @@ ``` |
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
139620
684
190