Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
update text parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Jan 30, 2016
1 parent 98cc675 commit 18b0440
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@

if (request.dataType == 'json' || request.headers.accept == 'application/json') {
return response.json();
} else if ((response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') == 0) {
} else if (request.dataType == 'text' || (response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') == 0) {
return response.text();
} else {
return response;
Expand Down Expand Up @@ -400,7 +400,7 @@

if (request.dataType == 'json' || request.headers.accept == 'application/json') {
return response.json();
} else if ((response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') == 0) {
} else if (request.dataType == 'text' || (response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') == 0) {
return response.text();
} else {
return response;
Expand Down Expand Up @@ -1304,6 +1304,9 @@
if (!path) {
throw new Error("null path");
}
if (typeof (path) !== 'string') {
throw new Error('invalid path');
}

options = options || {};

Expand Down Expand Up @@ -1347,7 +1350,8 @@

return self.ajax({
type: "GET",
url: url
url: url,
dataType: 'text'
});
};

Expand Down

0 comments on commit 18b0440

Please sign in to comment.