diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index 4eb872cd5f11..8bfd85516807 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -109,7 +109,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc } } - xhr.send(post || null); + xhr.send(post); } if (timeout > 0) { diff --git a/test/ng/httpBackendSpec.js b/test/ng/httpBackendSpec.js index 12ceed5beb01..bcec2db3c0ab 100644 --- a/test/ng/httpBackendSpec.js +++ b/test/ng/httpBackendSpec.js @@ -50,6 +50,13 @@ describe('$httpBackend', function() { expect(xhr.$$data).toBe(null); }); + it('should pass false to send if false body is set', function() { + $backend('GET', '/some-url', false, noop); + xhr = MockXhr.$$lastInstance; + + expect(xhr.$$data).toBe(false); + }); + it('should call completion function with xhr.statusText if present', function() { callback.andCallFake(function(status, response, headers, statusText) { expect(statusText).toBe('OK');