diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..43c97e7
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+package-lock=false
diff --git a/package.json b/package.json
index 2d80663..b0a1578 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"dependencies": {
"accepts": "^1.3.3",
"debug": "^2.2.0",
- "ejs": "^2.4.2",
+ "ejs": "^2.5.7",
"http-status": "^1.0.0",
"js2xmlparser": "^3.0.0",
"strong-globalize": "^3.1.0"
diff --git a/test/handler.test.js b/test/handler.test.js
index 9dd6c80..5d6b44f 100644
--- a/test/handler.test.js
+++ b/test/handler.test.js
@@ -472,6 +472,47 @@ describe('strong-error-handler', function() {
done);
});
+ it('HTML-escapes all 4xx response properties in production mode',
+ function(done) {
+ const error = new ErrorWithProps({
+ name: 'Error',
+ message:
+ 'No instance with id
found for Model',
+ statusCode: 404,
+ });
+ givenErrorHandlerForError(error, {debug: false});
+ requestHTML()
+ .end(function(err, res) {
+ expect(res.statusCode).to.eql(404);
+ const body = res.error.text;
+ expect(body).to.match(
+ /