Socket
Socket
Sign inDemoInstall

send

Package Overview
Dependencies
17
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.16.2 to 0.17.0

28

HISTORY.md

@@ -0,1 +1,29 @@

0.17.0 / 2019-05-03
===================
* deps: http-errors@~1.7.2
- Set constructor name when possible
- Use `toidentifier` module to make class names
- deps: depd@~1.1.2
- deps: setprototypeof@1.1.1
- deps: statuses@'>= 1.5.0 < 2'
* deps: mime@1.6.0
- Add extensions for JPEG-2000 images
- Add new `font/*` types from IANA
- Add WASM mapping
- Update `.bdoc` to `application/bdoc`
- Update `.bmp` to `image/bmp`
- Update `.m4a` to `audio/mp4`
- Update `.rtf` to `application/rtf`
- Update `.wav` to `audio/wav`
- Update `.xml` to `application/xml`
- Update generic extensions to `application/octet-stream`:
`.deb`, `.dll`, `.dmg`, `.exe`, `.iso`, `.msi`
- Use mime-score module to resolve extension conflicts
* deps: ms@2.1.1
- Add `week`/`w` support
- Fix negative number handling
* deps: statuses@~1.5.0
* perf: remove redundant `path.normalize` call
0.16.2 / 2018-02-07

@@ -2,0 +30,0 @@ ===================

3

index.js

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

path = normalize(join(root, path))
root = normalize(root + sep)
} else {

@@ -673,3 +672,3 @@ // ".." is malicious without "root"

return this.error(416, {
headers: {'Content-Range': res.getHeader('Content-Range')}
headers: { 'Content-Range': res.getHeader('Content-Range') }
})

@@ -676,0 +675,0 @@ }

{
"name": "send",
"description": "Better streaming static file server with Range and conditional-GET support",
"version": "0.16.2",
"version": "0.17.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -26,21 +26,21 @@ "contributors": [

"fresh": "0.5.2",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"http-errors": "~1.7.2",
"mime": "1.6.0",
"ms": "2.1.1",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
"statuses": "~1.5.0"
},
"devDependencies": {
"after": "0.8.2",
"eslint": "3.19.0",
"eslint-config-standard": "10.2.1",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-markdown": "1.0.0-beta.6",
"eslint-plugin-node": "5.2.1",
"eslint-plugin-promise": "3.6.0",
"eslint-plugin-standard": "3.0.1",
"eslint": "5.16.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-markdown": "1.0.0",
"eslint-plugin-node": "8.0.1",
"eslint-plugin-promise": "4.1.1",
"eslint-plugin-standard": "4.0.0",
"istanbul": "0.4.5",
"mocha": "2.5.3",
"supertest": "1.1.0"
"mocha": "6.1.4",
"supertest": "4.0.2"
},

@@ -47,0 +47,0 @@ "files": [

# send
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Linux Build][travis-image]][travis-url]

@@ -177,6 +177,26 @@ [![Windows Build][appveyor-image]][appveyor-url]

### Small example
### Serve a specific file
This simple example will send a specific file to all requests.
```js
var http = require('http')
var send = require('send')
var server = http.createServer(function onRequest (req, res) {
send(req, '/path/to/index.html')
.pipe(res)
})
server.listen(3000)
```
### Serve all files from a directory
This simple example will just serve up all the files in a
given directory as the top-level. For example, a request
`GET /foo.txt` will send back `/www/public/foo.txt`.
```js
var http = require('http')
var parseUrl = require('parseurl')

@@ -186,3 +206,4 @@ var send = require('send')

var server = http.createServer(function onRequest (req, res) {
send(req, parseUrl(req).pathname).pipe(res)
send(req, parseUrl(req).pathname, { root: '/www/public' })
.pipe(res)
})

@@ -209,3 +230,4 @@

var server = http.createServer(function onRequest (req, res) {
send(req, parseUrl(req).pathname).pipe(res)
send(req, parseUrl(req).pathname, { root: '/www/public' })
.pipe(res)
})

@@ -230,5 +252,5 @@

var server = http.createServer(function onRequest (req, res) {
send(req, parseUrl(req).pathname, {index: false, root: '/www/example.com/public'})
.once('directory', directory)
.pipe(res)
send(req, parseUrl(req).pathname, { index: false, root: '/www/public' })
.once('directory', directory)
.pipe(res)
})

@@ -287,7 +309,7 @@

// /www/example.com/public/*
send(req, parseUrl(req).pathname, {root: '/www/example.com/public'})
.on('error', error)
.on('directory', redirect)
.on('headers', headers)
.pipe(res)
send(req, parseUrl(req).pathname, { root: '/www/public' })
.on('error', error)
.on('directory', redirect)
.on('headers', headers)
.pipe(res)
})

@@ -302,11 +324,12 @@

[npm-image]: https://img.shields.io/npm/v/send.svg
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/send/master?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send
[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master
[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master
[node-image]: https://badgen.net/npm/node/send
[node-url]: https://nodejs.org/en/download/
[npm-downloads-image]: https://badgen.net/npm/dm/send
[npm-url]: https://npmjs.org/package/send
[travis-image]: https://img.shields.io/travis/pillarjs/send/master.svg?label=linux
[npm-version-image]: https://badgen.net/npm/v/send
[travis-image]: https://badgen.net/travis/pillarjs/send/master?label=linux
[travis-url]: https://travis-ci.org/pillarjs/send
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/send/master.svg?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/send/master.svg
[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master
[downloads-image]: https://img.shields.io/npm/dm/send.svg
[downloads-url]: https://npmjs.org/package/send
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc