Pedestal is not responding to preflight OPTIONS requests? I am deep in some development machine CORS issues and it seems like I need to explicitly create OPTIONS variants for every single API route? I don't remember needing to do this before...
Add ::http/allowed-origins (fn [origin] (contains? #{"localhost"} origin)) to your service map
See http://pedestal.io/api/0.6/io.pedestal.http.cors.html for additional options including methods (Defaults to “GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS”)
Thanks… for some reason I had ::http/allow-origins in my service map, not allowed. Stupid mistake.
… but aren’t they always? The bugs you spend the longest time on are always the dumbest little things…
Does your editor use LSP? Just enable the experimental clj-kondo option "warn-if-keyword-is-used-which-isnt-mentioned-in-the-corresponding-readme"
I use IntelliJ, so I don’t think that’s an option?
clever solution, though.
My tip is never write a keyword. Always copy/paste.
I think the dizzying number of options in the service map is undesirable. I’ve been noodling in the background about what would be better.