title: AngularJS, $http and interceptor - every request received twice in nodejs
body: <p>I'm trying to use AngularJS' $http interceptor for adding a token on every API call.</p>
  
  <p>This is my code (<a href="http://pastebin.com/x1EMGcVE" rel="nofollow">http://pastebin.com/x1EMGcVE</a>):</p>
  
  <pre><code>.factory('authInterceptor', function(authorization, API) {
      return {
          request: function(config) {
              var token = authorization.getToken();
              if (config.url.indexOf(API) === 0 &amp;&amp; token) {
                  config.headers.Authorization = token;
              }
              return config;
          }
      }
  })
  </code></pre>
  
  <p>On my nodes backend I'm receiving the call with express:</p>
  
  <pre><code>app.route('/API-CALL')
      .get(function(req, res) {
          ...
  </code></pre>
  
  <p>My problem is that every API request is received twice in nodejs, one request without the token added in Authorization and one with the token added.</p>
  
  <p>Is this an issue with the interceptor? Outputting the config from the interceptor seems to show no issues and only the correct number of requests with the token added.</p>
  
  <p>If I remove the:</p>
  
  <pre><code>$httpProvider.interceptors.push('authInterceptor');
  </code></pre>
  
  <p>calls are only made once, but of course without the token added.</p>