From b13da18e11d5f67696906d1ecd2fc9e753d50da4 Mon Sep 17 00:00:00 2001 From: Andrew McLeod Date: Mon, 25 Feb 2013 21:25:18 -0800 Subject: fix($http): don't encode URL query substring "null" to "+" Fixes issue in encodeUriQuery used by $http and $resource that treats null as a string and replaces the characters "null" with "+". --- test/AngularSpec.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/AngularSpec.js') diff --git a/test/AngularSpec.js b/test/AngularSpec.js index e734decf..c535bf12 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -415,6 +415,14 @@ describe('angular', function() { //encode ' ' as '%20' when a flag is used expect(encodeUriQuery(' ', true)). toEqual('%20%20'); + + //do not encode `null` as '+' when flag is used + expect(encodeUriQuery('null', true)). + toEqual('null'); + + //do not encode `null` with no flag + expect(encodeUriQuery('null')). + toEqual('null'); }); }); @@ -673,7 +681,7 @@ describe('angular', function() { toBe(''); }); }); - + describe('startingTag', function() { it('should allow passing in Nodes instead of Elements', function() { var txtNode = document.createTextNode('some text'); -- cgit v1.2.3