I am making a CORS xhr request. This works fine in chrome, however when I run in safari I get an \'Can not load ---- access not allowed by Access-control-allow-origin\'.
Im not sure if anyone else will have this problem but I was making a request to a URL like:
https://api.website.com/api/v1/users/auth0|5ef7502019360a7/
The |
(pipe) character in the URL was causing a strange issue with Safari because it was not being URL Encoded correctly.
In my Javascript I simply replaced my old url:
const url = "https://api.website.com/api/v1/user/auth0|5ef27593603a7";
with
const url = "https://api.website.com/api/v1/user/auth0|5ef27593603a7".replace("|", "%7C");
%7C
is the correct URL encoding for the |
(pipe) character.
Hope this helps someone!