Angular2 Http missed "Authentication" header in CORS preflight actual (second) request
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Http missed the “Authentication” header in the actual (second) request of CORS preflight session. please see https://forum.ionicframework.com/t/cr3-http-missed-authorization-header-in-cors-preflight-actual-request/73630 Expected behavior
Http should insert the “Authorization” header in the actual POST message headers after the success of “OPTIONS” round in a CORS preflight scenario Minimal reproduction of the problem with instructions
set up a Restful service with CORS capacity; send a request with a “Authentication: Bear” token in the message; then try to extract the “Authentication” header from the received message at the server side What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Ionic2 RC3 – emulated on Ubuntu 16.04 LTS Linux 4.4
- Angular version: 2.1.1
- Browser: [ Chromium 53.0.2785.143 Built on Ubuntu ]
-
Language: [TypeScript 2.0.3 ]
-
Node (for AoT issues):
node --version
= v4.6.2
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:13 (5 by maintainers)
After hours of search I found a solution. Add
"Access-Control-Expose-Headers" : "Authorization"
on the server side to expose the Authorization header.This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.