(data, headers)
| 9713 | } |
| 9714 | |
| 9715 | function defaultHttpResponseTransform(data, headers) { |
| 9716 | if (isString(data)) { |
| 9717 | // Strip json vulnerability protection prefix and trim whitespace |
| 9718 | var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); |
| 9719 | |
| 9720 | if (tempData) { |
| 9721 | var contentType = headers('Content-Type'); |
| 9722 | if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) { |
| 9723 | data = fromJson(tempData); |
| 9724 | } |
| 9725 | } |
| 9726 | } |
| 9727 | |
| 9728 | return data; |
| 9729 | } |
| 9730 | |
| 9731 | function isJsonLike(str) { |
| 9732 | var jsonStart = str.match(JSON_START); |
nothing calls this directly
no test coverage detected