Cors plugin doesn't work anymore


Looks like there is a bug in the cors plugin cors/caddy at master · captncraig/cors · GitHub .

There is a open issue about this Cors directive/plugin being ignored · Issue #13 · captncraig/cors · GitHub .
Have anyone else observed the same issue?
Is there another cors solution for caddy in the meantime until the bug is fixed?

Pinging @captncraig - my time is a bit limited, but is there something I can do to help debug this?

I also don’t really have much time to dig into that at the moment. And I have not had need for that functionality for some time, so its kinda been neglected. I’d gladly allow someone else interested in taking over that plugin to maintain it going forward.

1 Like

Well can we then remove it from the doc site?
A none working plugin does not help anyone.

I have change the line cors/cors.go at master · captncraig/cors · GitHub to r.Header.Get and now I get the right headers.
@captncraig Is this a proper fix?

No, that is definitely supposed to be w. I’ll try to repro tonight.

Actually, I am not convinced that issue is an actual bug. The requests in question don’t seem an accurate reflection of actual cross-origin requests from a browser that the plugin is intended to help with. Namely, they never set the Origin header. Can you please provider more details and specific requests that do not behave as you expect?

@captncraig you are right. When I use the orgin header the cors add the right headers. I can now make ajax calls with chrome. Sorry for the rush.
I have added a comment with my solution on github Cors directive/plugin being ignored · Issue #13 · captncraig/cors · GitHub

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.