aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBruno Baia2013-11-19 00:30:36 +0100
committerIgor Minar2014-03-16 09:52:44 -0700
commitfbb125a3af164e52af2f8119175b04cbbed2f331 (patch)
tree93cab555e478c4bb62727901522e01ac89fc14a4 /src
parentca7336391aba0f1c76b89381742716e98df67576 (diff)
downloadangular.js-fbb125a3af164e52af2f8119175b04cbbed2f331.tar.bz2
fix($http): allow sending Blob data using $http
Closes #5012
Diffstat (limited to 'src')
-rw-r--r--src/.jshintrc1
-rw-r--r--src/Angular.js6
-rw-r--r--src/ng/http.js2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/.jshintrc b/src/.jshintrc
index f32caa45..35bba32e 100644
--- a/src/.jshintrc
+++ b/src/.jshintrc
@@ -64,6 +64,7 @@
"isWindow": false,
"isScope": false,
"isFile": false,
+ "isBlob": false,
"isBoolean": false,
"trim": false,
"isElement": false,
diff --git a/src/Angular.js b/src/Angular.js
index 68ae9295..96df13f4 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -45,6 +45,7 @@
-isWindow,
-isScope,
-isFile,
+ -isBlob,
-isBoolean,
-trim,
-isElement,
@@ -566,6 +567,11 @@ function isFile(obj) {
}
+function isBlob(obj) {
+ return toString.call(obj) === '[object Blob]';
+}
+
+
function isBoolean(value) {
return typeof value === 'boolean';
}
diff --git a/src/ng/http.js b/src/ng/http.js
index 0c54f5bb..c7dc64e2 100644
--- a/src/ng/http.js
+++ b/src/ng/http.js
@@ -103,7 +103,7 @@ function $HttpProvider() {
// transform outgoing request data
transformRequest: [function(d) {
- return isObject(d) && !isFile(d) ? toJson(d) : d;
+ return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d;
}],
// default headers