mirror of
https://github.com/zebrajr/express.git
synced 2026-01-15 12:15:27 +00:00
committed by
Douglas Christopher Wilson
parent
11192bd168
commit
7f4e37f3ea
@@ -2,6 +2,7 @@ unreleased
|
||||
==========
|
||||
|
||||
* Add `express.raw` to parse bodies into `Buffer`
|
||||
* Add `express.text` to parse bodies into string
|
||||
* Improve error message for non-strings to `res.sendFile`
|
||||
* Improve error message for `null`/`undefined` to `res.status`
|
||||
* Support multiple hosts in `X-Forwarded-Host`
|
||||
|
||||
@@ -79,6 +79,7 @@ exports.json = bodyParser.json
|
||||
exports.query = require('./middleware/query');
|
||||
exports.raw = bodyParser.raw
|
||||
exports.static = require('serve-static');
|
||||
exports.text = bodyParser.text
|
||||
exports.urlencoded = bodyParser.urlencoded
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,6 +24,11 @@ describe('exports', function(){
|
||||
assert.equal(express.static.length, 2)
|
||||
})
|
||||
|
||||
it('should expose text middleware', function () {
|
||||
assert.equal(typeof express.text, 'function')
|
||||
assert.equal(express.text.length, 1)
|
||||
})
|
||||
|
||||
it('should expose urlencoded middleware', function () {
|
||||
assert.equal(typeof express.urlencoded, 'function')
|
||||
assert.equal(express.urlencoded.length, 1)
|
||||
|
||||
Reference in New Issue
Block a user