Context
XHR requests with Authorization header over HTTPS (both together) don't reach the server, using Safari (IOS and MacOS). But it works with IE, Chrome and Firefox.
I use a valid certificate generated by Letsencrypt and browsers don't display warnings about it.
On the web inspector of Safari, these XHRs try to get result until timeout and no errors displayed.
I have one domain and no sub-domain.
Test
- Authorization header + HTTPS => Not working
- Authorization header + No HTTPS (HTTP) => Works
- No authorization header + HTTPS => Works
Code
I use an interceptor to set authorization header.
this.request = (config) => {
config.headers = config.headers || {};
var authData = localStorageService.get('authorizationData');
if (authData && config.url && !config.url.endsWith("/token")) {
config.headers = {
"Authorization": 'Bearer ' + authData.access_token
};
config.withCredentials = true;
}
return config;
}
Has anyone encountered the same problems ?
UPDATE 1
There is something wrong with Safari + HTTPS + "Authorization" header. If I rename "Authorization" by "MyHeader", and doing some modification on server to retrieve my bearer token with "MyHeader" token, everything works well.
Is "Authorization" header a protected word using HTTPS on safari ?