MCPcopy Index your code
hub / github.com/angular-ui/ui-router / defaultHttpResponseTransform

Function defaultHttpResponseTransform

test/angular/1.4/angular.js:9715–9729  ·  view source on GitHub ↗
(data, headers)

Source from the content-addressed store, hash-verified

9713}
9714
9715function 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
9731function isJsonLike(str) {
9732 var jsonStart = str.match(JSON_START);

Callers

nothing calls this directly

Calls 3

isStringFunction · 0.70
isJsonLikeFunction · 0.70
fromJsonFunction · 0.70

Tested by

no test coverage detected