File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ unreleased
2
2
==========
3
3
4
4
* Add ` express.raw ` to parse bodies into ` Buffer `
5
+ * Add ` express.text ` to parse bodies into string
5
6
* Improve error message for non-strings to ` res.sendFile `
6
7
* Improve error message for ` null ` /` undefined ` to ` res.status `
7
8
* Support multiple hosts in ` X-Forwarded-Host `
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ exports.json = bodyParser.json
79
79
exports . query = require ( './middleware/query' ) ;
80
80
exports . raw = bodyParser . raw
81
81
exports . static = require ( 'serve-static' ) ;
82
+ exports . text = bodyParser . text
82
83
exports . urlencoded = bodyParser . urlencoded
83
84
84
85
/**
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ describe('exports', function(){
24
24
assert . equal ( express . static . length , 2 )
25
25
} )
26
26
27
+ it ( 'should expose text middleware' , function ( ) {
28
+ assert . equal ( typeof express . text , 'function' )
29
+ assert . equal ( express . text . length , 1 )
30
+ } )
31
+
27
32
it ( 'should expose urlencoded middleware' , function ( ) {
28
33
assert . equal ( typeof express . urlencoded , 'function' )
29
34
assert . equal ( express . urlencoded . length , 1 )
You can’t perform that action at this time.
0 commit comments