title: unable to execute post request with authorization header
body: <p>I have an issue in angular 4 when I post a request API with Authorization header?</p>
  
  <pre><code>addPost(body): Observable&lt;any&gt;{
        const url = 'https://xxxxxx';
  
       return this.http.post(URL, body, this.options)
       .map((res:Response) =&gt; {
       this.data = res.json();
       })
  }
  </code></pre>
  
  <p>token comes from firebase auth</p>
  
  <pre><code>afAuth.auth.currentUser.getIdToken()
      .then(token =&gt; {
          this.headers = new Headers({
              'Authorization': 'Bearer '+token
          });
          this.headers.append('Content-Type', 'application/json');
          this.options = new RequestOptions({ headers: this.headers });
      });
  this.headers.append('Content-Type', 'application/json');
  this.options = new RequestOptions({ headers: this.headers });
  </code></pre>
  
  <p>I call post by this</p>
  
  <pre><code>return this.getJob.addPost(body).subscribe((data) =&gt; {
      console.log(data);
  });
  </code></pre>
  
  <p>Response 403!!!</p>
  
  <p>Request URL:<a href="https://us-central1-xxxxxx-prod.cloudfunctions.net/api/post" rel="nofollow noreferrer">https://us-central1-xxxxxx-prod.cloudfunctions.net/api/post</a>
  Request Method:OPTIONS<br/>
  Status Code:403 <br/>
  Remote Address:216.58.198.51:443<br/>
  Referrer Policy:no-referrer-when-downgrade<br/>
  Response Headers<br/>
  access-control-allow-methods:GET, POST<br/>
  access-control-allow-origin:<em><br/>
  cache-control:private<br/>
  content-encoding:gzip<br/>
  content-length:32<br/>
  content-type:text/html; charset=utf-8<br/>
  date:Tue, 08 Aug 2017 12:23:55 GMT<br/>
  etag:W/"c-dAuDFQrdjS3hezqxDTNgW7AOlYk"<br/>
  function-execution-id:d0la00v58w7p<br/>
  server:Google Frontend<br/>
  status:403<br/>
  vary:Accept-Encoding<br/>
  x-cloud-trace-context:d1b6ff9d729f7e250193a70aea16cac1;o=1<br/>
  x-cloud-trace-context:d1b6ff9d729f7e250193a70aea16cac1<br/>
  x-powered-by:Express<br/>
  Request Headers<br/>
  :authority:us-central1-xxxxxx-prod.cloudfunctions.net<br/>
  :method:OPTIONS<br/>
  :path:/api/post<br/>
  :scheme:https<br/>
  accept:</em>/*<br/>
  accept-encoding:gzip, deflate, br<br/>
  accept-language:en-US,en;q=0.8,ar;q=0.6<br/>
  access-control-request-headers:authorization,content-type<br/>
  access-control-request-method:POST<br/>
  alexatoolbar-alx_ns_ph:AlexaToolbar/alx-4.0.1<br/>
  cache-control:no-cache<br/>
  origin:<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a><br/>
  pragma:no-cache<br/>
  referer:<a href="http://localhost:8080/extras/addjobpost" rel="nofollow noreferrer">http://localhost:8080/extras/addjobpost</a><br/>
  user-agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like <br/>Gecko) Chrome/59.0.3071.115 Safari/537.36
  <br/></p>