title: Angular 5 Http Interceptor don't detect response header (POST)
body: <p>I'm not able to get the custom response header in interceptor when i console log it. <a href="https://i.stack.imgur.com/HlHLv.jpg" rel="noreferrer">console logged the interceptor httpResponse</a></p>
  
  <p><strong>''Console log response''</strong></p>
  
  <p>HttpResponse {
  headers: HttpHeaders, status: 200, statusText: "OK", ok: true, …
  }</p>
  
  <p>HttpHeaders
  lazyInit
  :
  ƒ ()
  lazyUpdate
  :
  null
  normalizedNames
  :
  Map(0) {}
  <strong>proto</strong>
  :
  Object
  ok
  :
  true
  status
  :
  200
  statusText
  :
  "OK"
  type
  :
  4</p>
  
  <p>We also added the <em>Access-control-expose-header</em> in the server side. Still i'm not getting the response. Not sure whether i miss something in the interceptor method. </p>
  
  <p><strong>Interceptor method</strong></p>
  
  <pre><code>intercept(req: HttpRequest&lt;any&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;any&gt;&gt; {
          req = req.clone({
              setHeaders: {
                  'Accept': 'application/vnd.employee.tonguestun.com; version=1',
                  'Content-Type': 'application/json',
              }
          });
  
      return next.handle(req)
          .do((ev: HttpEvent&lt;any&gt;) =&gt; {
              console.log(ev)
              if (ev instanceof HttpResponse) {
                  console.log(ev.headers);
              }
              // return ev;
          })
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wappX.jpg" rel="noreferrer">interceptor fuction</a></p>
  
  <p><strong>Custom header in network tab</strong></p>
  
  <p>access-control-allow-credentials: true</p>
  
  <p>access-control-allow-methods: GET, POST, OPTIONS</p>
  
  <p>access-control-allow-origin: *</p>
  
  <p>access-control-expose-headers: access-token,client,expiry,token-type,uid</p>
  
  <p>access-token: haIXZmNWSdKJqN2by7JH1g</p>
  
  <p>cache-control: max-age=0, private, must-revalidate</p>
  
  <p>client: j_2dxD7NVMjGeX8BbBuELA</p>
  
  <p>content-type: application/json; charset=utf-8</p>
  
  <p>expiry: 1525931943</p>
  
  <p><a href="https://i.stack.imgur.com/SdUs2.jpg" rel="noreferrer">getting custom headers in network tab</a></p>
  
  <p>Also this is my service call, added observe 'response' in the call too.</p>
  
  <p><strong>Service call</strong></p>
  
  <pre><code>return this.http.post(`${environment.baseUrl}${environment.signup}`, data, {observe: "response"})
    .map(response =&gt; response);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mJM3j.jpg" rel="noreferrer">service call</a></p>
  
  <p><strong>AppModule.ts</strong></p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
     import { NgModule } from '@angular/core';
     import { CommonModule } from '@angular/common';
  
     import { AppComponent } from './app.component';
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
  import { HttpClientModule } from '@angular/common/http';
  import { HTTP_INTERCEPTORS } from '@angular/common/http';
  import { AppInterceptor } from './services/app-interceptor.service';
  
  import { HomeModule } from './home/home.module'; 
  import { SharedModule } from './shared/shared.module';
  import { AppRoutingModule } from './app-routing.module';
  import { AuthService } from './services/auth.service';
  import { AuthGuardService } from './services/auth-guard.service';
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
  
  @NgModule({
    declarations: [
      AppComponent
    ],
    imports: [
      BrowserModule,
      FormsModule,
      ReactiveFormsModule,
      CommonModule,
      HttpClientModule,
      BrowserAnimationsModule,
      HomeModule,
      SharedModule,
      AppRoutingModule,
    ],
    providers: [
      AuthService,
      AuthGuardService,
      {
        provide: HTTP_INTERCEPTORS,
        useClass: AppInterceptor,
        multi: true
      },
    ],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <p>Help me please. Thanks in advance!</p>