This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ function $HttpParamSerializerProvider() {
41
41
if ( ! params ) return '' ;
42
42
var parts = [ ] ;
43
43
forEachSorted ( params , function ( value , key ) {
44
- if ( value === null || isUndefined ( value ) ) return ;
44
+ if ( value === null || isUndefined ( value ) || isFunction ( value ) ) return ;
45
45
if ( isArray ( value ) ) {
46
46
forEach ( value , function ( v ) {
47
47
parts . push ( encodeUriQuery ( key ) + '=' + encodeUriQuery ( serializeValue ( v ) ) ) ;
Original file line number Diff line number Diff line change @@ -2344,14 +2344,17 @@ describe('$http param serializers', function() {
2344
2344
expect ( defSer ( { someDate : new Date ( '2014-07-15T17:30:00.000Z' ) } ) ) . toEqual ( 'someDate=2014-07-15T17:30:00.000Z' ) ;
2345
2345
expect ( jqrSer ( { someDate : new Date ( '2014-07-15T17:30:00.000Z' ) } ) ) . toEqual ( 'someDate=2014-07-15T17:30:00.000Z' ) ;
2346
2346
} ) ;
2347
-
2348
2347
} ) ;
2349
2348
2350
2349
describe ( 'default array serialization' , function ( ) {
2351
2350
2352
2351
it ( 'should serialize arrays by repeating param name' , function ( ) {
2353
2352
expect ( defSer ( { a : 'b' , foo : [ 'bar' , 'baz' ] } ) ) . toEqual ( 'a=b&foo=bar&foo=baz' ) ;
2354
2353
} ) ;
2354
+
2355
+ it ( 'should NOT serialize functions' , function ( ) {
2356
+ expect ( defSer ( { foo : 'foov' , bar : function ( ) { } } ) ) . toEqual ( 'foo=foov' ) ;
2357
+ } ) ;
2355
2358
} ) ;
2356
2359
2357
2360
describe ( 'jquery array and objects serialization' , function ( ) {
You can’t perform that action at this time.
0 commit comments