Skip to content

Commit

Permalink
Remove deprecated root method
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Dec 13, 2022
1 parent c3aeb1c commit da1365b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Remove `send.etag()` -- use `etag` in `options`
* Remove `send.index()` -- use `index` in `options`
* Remove `send.maxage()` -- use `maxAge` in `options`
* Remove `send.root()` -- use `root` in `options`

0.17.2 / 2021-12-11
===================
Expand Down
17 changes: 0 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,6 @@ SendStream.prototype.hidden = deprecate.function(function hidden (val) {
return this
}, 'send.hidden: use dotfiles option')

/**
* Set root `path`.
*
* @param {String} path
* @return {SendStream}
* @api public
*/

SendStream.prototype.root = function root (path) {
this._root = resolve(String(path))
debug('root %s', this._root)
return this
}

SendStream.prototype.root = deprecate.function(SendStream.prototype.root,
'send.root: pass root as option')

/**
* Emit error with `status`.
*
Expand Down
14 changes: 0 additions & 14 deletions test/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,20 +785,6 @@ describe('send(file).pipe(res)', function () {
.expect(200, 'secret', done)
})
})

describe('.root()', function () {
it('should set root', function (done) {
var app = http.createServer(function (req, res) {
send(req, req.url)
.root(fixtures)
.pipe(res)
})

request(app)
.get('/pets/../name.txt')
.expect(200, 'tobi', done)
})
})
})

describe('send(file, options)', function () {
Expand Down

0 comments on commit da1365b

Please sign in to comment.