🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

serve-static

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve-static - npm Package Compare versions

Comparing version

to
2.0.0-beta.1

10

HISTORY.md

@@ -0,1 +1,11 @@

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
* deps: send@1.0.0-beta.1
- Use `mime-types` for file to content type mapping
- deps: debug@3.1.0
1.14.2 / 2021-12-15

@@ -2,0 +12,0 @@ ===================

1

index.js

@@ -29,3 +29,2 @@ /*!

module.exports = serveStatic
module.exports.mime = send.mime

@@ -32,0 +31,0 @@ /**

{
"name": "serve-static",
"description": "Serve static files",
"version": "1.14.2",
"version": "2.0.0-beta.1",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -12,3 +12,3 @@ "license": "MIT",

"parseurl": "~1.3.3",
"send": "0.17.2"
"send": "1.0.0-beta.1"
},

@@ -34,3 +34,3 @@ "devDependencies": {

"engines": {
"node": ">= 0.8.0"
"node": ">= 0.10"
},

@@ -37,0 +37,0 @@ "scripts": {

@@ -48,3 +48,3 @@ # serve-static

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

@@ -60,4 +60,3 @@ the path itself without checking if the path actually exists on the

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'`.

@@ -220,3 +219,3 @@ ##### etag

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.

@@ -238,4 +237,4 @@

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

@@ -242,0 +241,0 @@ res.setHeader('Cache-Control', 'public, max-age=0')