(data, headers)
| 9238 | } |
| 9239 | |
| 9240 | function defaultHttpResponseTransform(data, headers) { |
| 9241 | if (isString(data)) { |
| 9242 | // Strip json vulnerability protection prefix and trim whitespace |
| 9243 | var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); |
| 9244 | |
| 9245 | if (tempData) { |
| 9246 | var contentType = headers('Content-Type'); |
| 9247 | if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) { |
| 9248 | data = fromJson(tempData); |
| 9249 | } |
| 9250 | } |
| 9251 | } |
| 9252 | |
| 9253 | return data; |
| 9254 | } |
| 9255 | |
| 9256 | function isJsonLike(str) { |
| 9257 | var jsonStart = str.match(JSON_START); |
nothing calls this directly
no test coverage detected