title: IE10 interprets status codes 401/403 as network error
body: <p>I have an AngularJS <code>responseError</code> interceptor that broadcasts events for 401 and 403 HTTP status codes. But there is a bug in IE10 (<a href="https://stackoverflow.com/a/16320339/1053611">according to this</a>) when it gets a 401 status code from the server (not logged in) or 403 (not authorized), IE interprets this as a network error, so the <code>responseError</code> interceptor is never fired, thus the user is never redirected to the login page.</p>
  
  <p>Code:</p>
  
  <pre><code>app.factory('authHttpInterceptor', ["$rootScope", "AUTH_EVENTS", "$q", function ($rootScope, AUTH_EVENTS, $q) {
      return {
          'request': function (config) {
              return config;
          },
          'requestError': function (rejection) {
              return $q.reject(rejection);
          },
          'response': function (response) {
              return response;
          },
          'responseError': function (rejection) {
              $rootScope.$broadcast({
                  401: AUTH_EVENTS.notAuthenticated,
                  403: AUTH_EVENTS.notAuthorized
              }[rejection.status], rejection);
              return $q.reject(rejection);
          }
      };
  }]);
  </code></pre>
  
  <p>Here's a screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/dc5tT.png" alt="http://i.imgur.com/8iZQjFM.png"></p>
  
  <p>Is there any solution to this?</p>
  
  <p><strong>Edit:</strong> <code>response</code> interceptor is fired and I was going to check there if the status was 401 or 403 and then broadcast it from there, but it's only fired if the response is a success (200 OK).</p>
  
  <p><strong>Edit 2:</strong> It turns out the <code>responseError</code> interceptor gets called, but with status code <code>0</code>.</p>
  
  <p><strong>Edit 3:</strong> I'm solving this by adding <code>0: AUTH_EVENTS.notAuthenticated,</code> because if we receive HTTP status code 0, clearly something is wrong.</p>