title: Restkit Authorization Header disappears
body: <p>I already searched everywhere and this issue that should have been trivial is taking longer than I wanted therefore I am reaching you for help.</p>
  
  <p>I am using swift and integrated restkit using cocoapods.</p>
  
  <p>Despite, as you can see the screenshots/log, the header is fine however the outgoing http packet is not consistent.</p>
  
  <p>AppDelegate:</p>
  
  <pre><code>RKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.value);
  RKlcl_configure_by_name("RestKit/ObjectMapping", RKlcl_vTrace.value);
  </code></pre>
  
  <p>ObjectManagerCode:</p>
  
  <pre><code>let objectManager: RKObjectManager = RKObjectManager(baseURL: NSURL(string: Endpoints.BaseUrl.toString()))
  objectManager.requestSerializationMIMEType = RKMIMETypeJSON;
  
  let username = "TestUser"
  let password = "password"
  
  objectManager.HTTPClient.setAuthorizationHeaderWithUsername(username, password: password)
  objectManager.HTTPClient.setDefaultHeader("whatIWantForChristmas", value: "You")
  objectManager.HTTPClient.allowsInvalidSSLCertificate = true
  </code></pre>
  
  <p>Request:</p>
  
  <pre><code>var requestUrl = cds.objectManager!.requestWithObject(
          nil,
          method: RKRequestMethod.GET,
          path: endpoint.path,
          parameters: endpoint.parameters())
  
  
  
  cds.objectManager!.getObjectsAtPath(
          endpoint.path,
          parameters: endpoint.parameters(),
          success:
          {
              (RKObjectRequestOperation, RKMappingResult) -&gt; Void in
  
              println(RKObjectRequestOperation.description)
              Logger.Info("Success");
          },
          failure: {
              (RKObjectRequestOperation, error) -&gt; Void in
  
              Logger.Error("Error: \(error.description)")
              println(RKObjectRequestOperation.HTTPRequestOperation.description)
  
          })
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>T restkit.network:RKObjectRequestOperation.m:178 GET 'http://website/api?format=json':
  
  request.headers={
      Accept = "application/json";
      "Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
      Authorization = "Basic VGVzdFVzZXI6cGFzc3dvcmQ=";
      "User-Agent" = "malaria-ios/1 (iPhone Simulator; iOS 8.3; Scale/2.00)";
      whatIWantForChristmas = You;
  }
  
  ...
  
  E restkit.network:RKObjectRequestOperation.m:576 Object request
  failed:Underlying HTTP request operation failed with error: 
  Error Domain=org.restkit.RestKit.ErrorDomain Code=-1011 "Expected status code in (200), got 403" 
  UserInfo=0x7ff54ae4f690 {NSLocalizedRecoverySuggestion={"detail":"Authentication credentials were not provided."}
  </code></pre>
  
  <p>What I figured out:
  I can send anything in the header as long as it isn't "Authorization", if I change to "Authorization2", ok. The header "WhatIWantForChristmas" is also there. The authorization isn't despite being present in the log! It seems that the underlying software filters.</p>
  
  <p>Out of paranoia I tried turning off firewall, cleaning project, reseting iOS simulator and nada. The application I used to see the HTTP packets is Charles.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Url for the screenshot pf Charles: <a href="http://s7.postimg.org/pfwn7kyq2/Screen_Shot_2015_06_20_at_21.jpg" rel="nofollow">http://s7.postimg.org/pfwn7kyq2/Screen_Shot_2015_06_20_at_21.jpg</a></p>