File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ describe('XML Body Parser', function() {
55
55
} ) ;
56
56
57
57
it ( 'should accept xmlParseOptions' , function ( done ) {
58
- createServer ( {
58
+ createServer ( {
59
59
xmlParseOptions : {
60
60
normalize : true , // Trim whitespace inside text nodes
61
61
normalizeTags : true , // Transform tags to lowercase
@@ -91,6 +91,16 @@ describe('XML Body Parser', function() {
91
91
. expect ( 200 , { parsed : { customer : { name : [ 'Bob' ] } } } , done ) ;
92
92
} ) ;
93
93
94
+ it ( 'should accept custom ContentType as function' , function ( done ) {
95
+ createServer ( {
96
+ type : ( ) => true
97
+ } ) ;
98
+ request ( app )
99
+ . post ( '/' )
100
+ . send ( '<customer><name>Bob</name></customer>' )
101
+ . expect ( 200 , { parsed : { customer : { name : [ 'Bob' ] } } } , done ) ;
102
+ } ) ;
103
+
94
104
it ( 'should ignore non-XML' , function ( done ) {
95
105
createServer ( ) ;
96
106
You can’t perform that action at this time.
0 commit comments