Skip to content

Commit 09a66be

Browse files
authored
Merge pull request #885 from ecosyste-ms/add-cors-headers
Add wildcard CORS headers for API endpoints
2 parents 0f02e97 + 6399aed commit 09a66be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config/initializers/cors.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Rails.application.config.middleware.insert_before 0, Rack::Cors do
2+
allow do
3+
origins '*'
4+
resource /^\/api\/.+/, headers: :any, methods: [:get, :post, :patch, :put, :delete, :options, :head]
5+
end
6+
end

0 commit comments

Comments
 (0)