/**
 * This interceptor catch http 200 responses body that
 * contain a specific string portion. If the portion is found,
 * then the redirection happens.
 */

(function () {
    'use strict';

    angular
        .module('httpInterceptorModule', [])
        .factory('InterceptorConfigFactory', InterceptorConfigFactory)
        .config(appConfiguration);

    function InterceptorConfigFactory() {
        var errorStringSection = '<meta';

        return {
            redirectUrl: 'http://redirect.me',
            setRedirectUrl: function (url) {
                this.redirectUrl = url;

                return this.redirectUrl;
            },
            getStringToCheck: function () {
                return errorStringSection;
            }
        };
    }

    function appConfiguration($httpProvider) {
        $httpProvider.interceptors.push(interceptorHandler);
    }

    // we dont want ot call indexOf on something that's not a string
    function isString(obj) {
        return (Object.prototype.toString.call(obj) === '[object String]');
    }

    function interceptorHandler($q, $window, InterceptorConfigFactory) {
        return {
            request: function (config) {
                console.log('config ->', config);

                return config;
            },
            response: function (response) {
                console.log('response ->', response);

                if (isString(response.data) && !!response.data &&
                    -1 !== response.data.indexOf(InterceptorConfigFactory.getStringToCheck())) {
                    $window.location.href = InterceptorConfigFactory.redirectUrl;
                }

                return response;
            },
            responseError: function (rejection) {
                return $q.reject(rejection);
            }
        };
    }
})();

@@ -405,34 +405,31 @@
     var 
-error
+sub
 String
-Section
+ToFind
  = '%3Cmet
@@ -655,28 +655,30 @@
     getS
+ubS
 tringTo
-Check
+Find
 : functi
@@ -712,26 +712,23 @@
 urn 
-error
+sub
 String
-Section
+ToFind
 ;%0A  
@@ -1528,20 +1528,22 @@
 getS
+ubS
 tringTo
-Check
+Find
 ()))

Rename vars