https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
+35 -6
View File
@@ -1,19 +1,48 @@
1.16.2 / 2024-09-11
2.2.0 / 2025-03-27
==================
* deps: send@^1.2.0
2.1.0 / 2024-09-10
===================
* deps: encodeurl@~2.0.0
* Changes from 1.16.0
* deps: send@^1.2.0
1.16.1 / 2024-09-11
===================
2.0.0 / 2024-08-23
==================
* deps: send@0.19.0
* deps:
* parseurl@^1.3.3
* excape-html@^1.0.3
* encodeurl@^2.0.0
* supertest@^6.3.4
* safe-buffer@^5.2.1
* nyc@^17.0.0
* mocha@^10.7.0
* Changes from 1.x
2.0.0-beta.2 / 2024-03-20
=========================
* deps: send@1.0.0-beta.2
2.0.0-beta.1 / 2022-02-05
=========================
* Change `dotfiles` option default to `'ignore'`
* Drop support for Node.js 0.8
* Remove `hidden` option; use `dotfiles` option instead
* Remove `mime` export; use `mime-types` package instead
* deps: send@1.0.0-beta.1
- Use `mime-types` for file to content type mapping
- deps: debug@3.1.0
1.16.0 / 2024-09-10
===================
* Remove link renderization in html while redirecting
1.15.0 / 2022-03-24
===================
+6 -10
View File
@@ -2,8 +2,7 @@
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
[![Windows Build][appveyor-image]][appveyor-url]
[![CI][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
## Install
@@ -45,7 +44,7 @@ true. Disabling this will ignore the `immutable` and `maxAge` options.
##### dotfiles
Set how "dotfiles" are treated when encountered. A dotfile is a file
Set how "dotfiles" are treated when encountered. A dotfile is a file
or directory that begins with a dot ("."). Note this check is done on
the path itself without checking if the path actually exists on the
disk. If `root` is specified, only the dotfiles above the root are
@@ -56,8 +55,7 @@ to "deny").
- `'deny'` Deny a request for a dotfile and 403/`next()`.
- `'ignore'` Pretend like the dotfile does not exist and 404/`next()`.
The default value is similar to `'ignore'`, with the exception that this
default will not ignore the files within a directory that begins with a dot.
The default value is `'ignore'`.
##### etag
@@ -215,7 +213,7 @@ app.listen(3000)
#### Different settings for paths
This example shows how to set a different max age depending on the served
file type. In this example, HTML files are not cached, while everything else
file. In this example, HTML files are not cached, while everything else
is for 1 day.
```js
@@ -232,8 +230,8 @@ app.use(serveStatic(path.join(__dirname, 'public'), {
app.listen(3000)
function setCustomCacheControl (res, path) {
if (serveStatic.mime.lookup(path) === 'text/html') {
function setCustomCacheControl (res, file) {
if (path.extname(file) === '.html') {
// Custom Cache-Control for HTML files
res.setHeader('Cache-Control', 'public, max-age=0')
}
@@ -244,8 +242,6 @@ function setCustomCacheControl (res, path) {
[MIT](LICENSE)
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master
[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux
-1
View File
@@ -26,7 +26,6 @@ var url = require('url')
*/
module.exports = serveStatic
module.exports.mime = send.mime
/**
* @param {string} root
+9 -10
View File
@@ -1,15 +1,15 @@
{
"name": "serve-static",
"description": "Serve static files",
"version": "1.16.2",
"version": "2.2.0",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
"license": "MIT",
"repository": "expressjs/serve-static",
"dependencies": {
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.19.0"
"encodeurl": "^2.0.0",
"escape-html": "^1.0.3",
"parseurl": "^1.3.3",
"send": "^1.2.0"
},
"devDependencies": {
"eslint": "7.32.0",
@@ -19,10 +19,9 @@
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0",
"mocha": "9.2.2",
"nyc": "15.1.0",
"safe-buffer": "5.2.1",
"supertest": "6.2.2"
"mocha": "^10.7.0",
"nyc": "^17.0.0",
"supertest": "^6.3.4"
},
"files": [
"LICENSE",
@@ -30,7 +29,7 @@
"index.js"
],
"engines": {
"node": ">= 0.8.0"
"node": ">= 18"
},
"scripts": {
"lint": "eslint .",