Phoenix Corsica plug - Cross-Origin Request Blocked

Viewed 393

I'm using Corsica to handle CORS and I use Axios to send my client-side requests. I used different browsers on different computers, and the requests all worked fine. The person I'm making the website for is living in Congo though, and he's getting the following error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://fajalobi.org/saveCoords. This can be fixed by moving the resource to the same domain or enabling CORS. saveCoords "Unhandled promise rejection" Error: Network Error

How is this possible? Are his browsers obsolete? Can I fix this somehow?

Axios request

 axios(
    {
        method: 'post',
        url: `${Url.value}/saveCoords`
        ,
        headers: {
            'X-Requested-With': 'XMLHttpRequest',
            'x-csrf-token': document.head.querySelector("[name~=csrf-token][content]").content
        }
        ,
        data: {
               coords: coords,
               name: name,
               label: label,
               surface: surface
        }

Router

pipeline :browser do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_flash
    plug :put_secure_browser_headers
    plug FajalobiWeb.Plugs.Locale
    plug FajalobiWeb.Plugs.Auth, repo: Fajalobi.Repo
    plug Corsica,
         origins: "*",
         log: [rejected: :error, invalid: :warn, accepted: :debug],
         allow_headers: :all,
         allow_methods: :all,
         allow_credentials: true
    plug :protect_from_forgery
  end
0 Answers
Related