(data, headers)
| 8631 | var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/; |
| 8632 | |
| 8633 | function defaultHttpResponseTransform(data, headers) { |
| 8634 | if (isString(data)) { |
| 8635 | // Strip json vulnerability protection prefix and trim whitespace |
| 8636 | var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); |
| 8637 | |
| 8638 | if (tempData) { |
| 8639 | var contentType = headers('Content-Type'); |
| 8640 | if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) { |
| 8641 | data = fromJson(tempData); |
| 8642 | } |
| 8643 | } |
| 8644 | } |
| 8645 | |
| 8646 | return data; |
| 8647 | } |
| 8648 | |
| 8649 | function isJsonLike(str) { |
| 8650 | var jsonStart = str.match(JSON_START); |
nothing calls this directly
no test coverage detected