aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/xhr.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/xhr.js')
-rw-r--r--src/service/xhr.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/service/xhr.js b/src/service/xhr.js
index 2f003398..6158b84f 100644
--- a/src/service/xhr.js
+++ b/src/service/xhr.js
@@ -79,8 +79,11 @@ angularServiceInject('$xhr', function($browser, $error, $log){
}
$browser.xhr(method, url, post, function(code, response){
try {
- if (isString(response) && /^\s*[\[\{]/.exec(response) && /[\}\]]\s*$/.exec(response)) {
- response = fromJson(response, true);
+ if (isString(response)) {
+ if (response.match(/^\)\]\}',\n/)) response=response.substr(6);
+ if (/^\s*[\[\{]/.exec(response) && /[\}\]]\s*$/.exec(response)) {
+ response = fromJson(response, true);
+ }
}
if (code == 200) {
callback(code, response);