From 0d0330adc24a68cd6891a030a56d3ce3bbced03c Mon Sep 17 00:00:00 2001 From: James Roper Date: Tue, 17 Sep 2013 14:24:35 +1000 Subject: fix($httpBackend): don't send empty string bodies The `XMLHttpRequest.send` spec defines different semantics for `null` than for an empty String: an empty String should be sent with a `Content-Type` of `text/plain`, whereas `null` should have no `Content-Type` header set. Closes #2149 --- src/ng/httpBackend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ng/httpBackend.js') diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index 37108209..99da6549 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -83,7 +83,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, xhr.responseType = responseType; } - xhr.send(post || ''); + xhr.send(post || null); } if (timeout > 0) { -- cgit v1.2.3