title: Http Response headers missing in chrome, but with Postman they show up
body: <p>When calling my REST Service in Angular, there are no response headers. </p>
  
  <p><strong>Login method in Angular</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>login(username: string, password: string) {
      const credentials = { "username": username, "password": password };
      return this.http.post(this.url, credentials)
        .subscribe(
          data =&gt; console.log(data), // JSON.stringify(data.headers) also is empty
          error =&gt; console.log(error)
        );
    }
  </code></pre>
  
  <p><strong>Output in the Chrome dev tools console</strong></p>
  
  <blockquote>
    <p>Response {_body: "", status: 200, ok: true, statusText: "OK", headers:
    Headers…}headers: Headers_headers: Map(0)_normalizedNames:
    Map(0)<strong>proto</strong>: Objectok: truestatus: 200statusText: "OK"type: 2url:
    "<a href="http://localhost:8080/backend/rest/login" rel="noreferrer">http://localhost:8080/backend/rest/login</a>"_body: ""<strong>proto</strong>: Body</p>
  </blockquote>
  
  <p>But when I send the same post request with postman, I get the expected result:</p>
  
  <pre><code>Access-Control-Allow-Credentials →true
  Access-Control-Allow-Origin →chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
  Authorization →Bearer eyJ[...]
  Connection →keep-alive
  Content-Length →0
  Date →Mon, 12 Jun 2017 13:19:54 GMT
  Server →WildFly/10
  Vary →Origin
  X-Powered-By →Undertow/1
  </code></pre>
  
  <p><strong>The REST Service</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>@POST
  @Consumes(MediaType.APPLICATION_JSON)
  public Response authenticateUser(CredentialsDTO credentialsDTO) {
      try {
          authService.login(credentialsDTO.getUsername(), credentialsDTO.getPassword());
      } catch (WrongCredentialsException e) {
  
          return Response.status(Status.FORBIDDEN).entity("WrongCredentialsException").build();
      } 
  
      // Issue token
      String token = issueToken(credentialsDTO.getUsername());
  
      // Return the token on the response
      return Response.ok().header(AUTHORIZATION, "Bearer " + token).build();
  }
  </code></pre>
  
  <p><strong>Why can't I see the headers in chrome ?</strong></p>
  
  <p><strong>UPDATE</strong>
  I am also using a CORSFilter that allowed Javascript to contact my backend in the first place. This is how it is configured in my web.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;filter&gt;
      &lt;filter-name&gt;CORS&lt;/filter-name&gt;
      &lt;filter-class&gt;com.thetransactioncompany.cors.CORSFilter&lt;/filter-class&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.allowGenericHttpRequests&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.allowOrigin&lt;/param-name&gt;
          &lt;param-value&gt;*&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.allowSubdomains&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.supportedMethods&lt;/param-name&gt;
          &lt;param-value&gt;GET, HEAD, POST, DELETE, OPTIONS&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.supportedHeaders&lt;/param-name&gt;
          &lt;param-value&gt;*&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.supportsCredentials&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;cors.maxAge&lt;/param-name&gt;
          &lt;param-value&gt;3600&lt;/param-value&gt;
      &lt;/init-param&gt;
  
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;!-- CORS Filter mapping --&gt;
      &lt;filter-name&gt;CORS&lt;/filter-name&gt;
      &lt;url-pattern&gt;*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>Although I thought it was configured to allow everything, I am not sure if this is related to my problem.</p>