Skip to content
Merged

1.1.1 #355

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.1

- Improved error handling.
- Updated dependencies.

## 1.1.0

- Breaking: Increased Node.js requirement to 22.5.0 or higher.
Expand Down
3 changes: 2 additions & 1 deletion express-html-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ function captureResponseBody (accept) {
this.writeHead(this.statusCode, statusMessage)
this.end(finalBody, callback)
}
Promise.resolve(rewrite(body)).then(send, error => { // send the body untouched rather than hanging the response if the rewrite fails
// the rewrite is called inside the chain rather than handed to Promise.resolve, so that a rewrite which throws outright is caught here alongside one that rejects; calling it first would let a throw escape res.end, taking the process down with the response never sent
Promise.resolve().then(() => rewrite(body)).then(send, error => { // send the body untouched rather than losing the response if the rewrite fails
process.emitWarning(error)
send(body)
})
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/rooseveltframework/express-html-validator/graphs/contributors"
}
],
"version": "1.1.0",
"version": "1.1.1",
"files": [
"templates",
"express-html-validator.js",
Expand All @@ -22,7 +22,7 @@
"node": ">=22.5.0"
},
"dependencies": {
"html-validate": "11.13.0",
"html-validate": "11.14.0",
"prismjs": "1.30.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const expressValidator = require('..')
const expressSetup = require('./lib/_expressSetup')
const { brokenValidatorSetup, invalidHTML, validHTML } = expressSetup

const port = 43711
// below 32768, which is where operating systems start handing out ports for outbound connections: linux uses 32768-60999 and macos and windows use 49152-65535, so a port inside those ranges can be taken by something else on the machine and leave the suite failing on a port nothing appears to be listening on
const port = 30711
const origin = `http://localhost:${port}`
const fixtures = path.join(__dirname, 'fixtures')
const validationFailed = 'HTML did not pass validator'
Expand Down