diff --git a/src/ng/http.js b/src/ng/http.js index 0ae6d0ef1b81..3088e422f32d 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -119,7 +119,7 @@ function $HttpProvider() { if (isString(data)) { // strip json vulnerability protection prefix data = data.replace(PROTECTION_PREFIX, ''); - var contentType = headers('Content-Type'); + var contentType = headers ? headers('Content-Type') : null; if ((contentType && contentType.indexOf(APPLICATION_JSON) === 0) || (JSON_START.test(data) && JSON_END.test(data))) { data = fromJson(data);