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
22==========
33
44 * Add ` express.raw ` to parse bodies into ` Buffer `
5+ * Add ` express.text ` to parse bodies into string
56 * Improve error message for non-strings to ` res.sendFile `
67 * Improve error message for ` null ` /` undefined ` to ` res.status `
78 * 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
7979exports . query = require ( './middleware/query' ) ;
8080exports . raw = bodyParser . raw
8181exports . static = require ( 'serve-static' ) ;
82+ exports . text = bodyParser . text
8283exports . urlencoded = bodyParser . urlencoded
8384
8485/**
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ describe('exports', function(){
2424 assert . equal ( express . static . length , 2 )
2525 } )
2626
27+ it ( 'should expose text middleware' , function ( ) {
28+ assert . equal ( typeof express . text , 'function' )
29+ assert . equal ( express . text . length , 1 )
30+ } )
31+
2732 it ( 'should expose urlencoded middleware' , function ( ) {
2833 assert . equal ( typeof express . urlencoded , 'function' )
2934 assert . equal ( express . urlencoded . length , 1 )
You can’t perform that action at this time.
0 commit comments