Open zd-project opened 5 years ago
I'm able to solve this issue with this snippet https://gist.github.com/saeidzebardast/e375b7d17be3e0f4dddf#gistcomment-2704256
Spark.staticFiles.header("Access-Control-Allow-Origin", "*");
Would be helpful to specify so in the documentation.
So I came a cross the similar situation to this question #973. I want to serve up some static files via sparkjava, with CORS enabled. But it seems that the "before" filter only works with specified routes in code but not with static files. I'm wondering how I should enable CORS on static files as well. Thanks.