Skip to content

Commit

Permalink
Merge next into master (#76)
Browse files Browse the repository at this point in the history
* update for Fastify v5 (#66)

* next

* fix istanbul

* update workflows (#70)

* Update .github/workflows/ci.yml

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>

---------

Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day>
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
3 people committed Jul 5, 2024
1 parent ca19a72 commit f01ef24
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ on:

jobs:
test:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.2.0
with:
license-check: true
lint: true
lint: true
node-versions: '["18", "20", "22"]'
6 changes: 4 additions & 2 deletions lib/SendStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,14 @@ SendStream.prototype.isCachable = function isCachable () {

SendStream.prototype.onStatError = function onStatError (error) {
// POSIX throws ENAMETOOLONG and ENOTDIR, Windows only ENOENT
/* istanbul ignore next */
switch (error.code) {
/* c8 ignore start */
case 'ENAMETOOLONG':
case 'ENOTDIR':
case 'ENOENT':
this.error(404, error)
break
/* c8 ignore stop */
default:
this.error(500, error)
break
Expand Down Expand Up @@ -570,10 +571,11 @@ SendStream.prototype.pipe = function pipe (res) {
containsDotFile(parts)
) {
switch (this._dotfiles) {
/* istanbul ignore next: unreachable, because NODE_DEBUG can not be set after process is running */
/* c8 ignore start */ /* unreachable, because NODE_DEBUG can not be set after process is running */
case 0: // 'allow'
debug('allow dotfile "%s"', path)
break
/* c8 ignore stop */
case 2: // 'deny'
debug('deny dotfile "%s"', path)
this.error(403)
Expand Down
1 change: 1 addition & 0 deletions lib/collapseLeadingSlashes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function collapseLeadingSlashes (str) {
return str.slice(i - 1)
}
}
/* c8 ignore next */
}

module.exports.collapseLeadingSlashes = collapseLeadingSlashes
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"escape-html": "~1.0.3",
"fast-decode-uri-component": "^1.0.1",
"http-errors": "2.0.0",
"mime": "^3.0.0",
"@lukeed/ms": "^2.0.1"
"mime": "^3",
"@lukeed/ms": "^2.0.2"
},
"devDependencies": {
"@fastify/pre-commit": "^2.0.2",
"@types/node": "^20.1.0",
"@fastify/pre-commit": "^2.1.0",
"@types/node": "^20.12.2",
"after": "0.8.2",
"benchmark": "^2.1.4",
"snazzy": "^9.0.0",
"standard": "^17.0.0",
"standard": "^17.1.0",
"supertest": "6.3.4",
"tap": "^16.3.3",
"tap": "^18.7.2",
"tsd": "^0.31.0"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions test/mime.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ test('send.mime', function (t) {
t.test('.default_type', function (t) {
t.plan(3)

t.before(function () {
t.before(() => {
this.default_type = send.mime.default_type
})

t.afterEach(function () {
t.afterEach(() => {
send.mime.default_type = this.default_type
})

Expand Down

0 comments on commit f01ef24

Please sign in to comment.