Cors_plug config


I was configuring cors_plug directly in endpoint.ex with :
plug CORSPlug, origin: "*", headers: ["X", "Y"]

Now I switch to config it to runtime.exs :

config :cors_plug,
    origin: "*",
    headers: ["X", "Y"]

The origin works fine but the headers are not working correctly (not allowed in response), I alse tried :

config :cors_plug,
    origin: "*",
    allow_headers: ["X", "Y"]

Not working also, any hints ?

In the lib documentation, I didn’t understand the line :

“Please note that options passed to the plug overrides app config but app config overrides default options.”