]> cat aescling's git repositories - mastodon.git/commitdiff
Use same CORS policy for /@:username and /users/:username (#9485)
authorThibG <thib@sitedethib.com>
Mon, 10 Dec 2018 20:39:47 +0000 (21:39 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 10 Dec 2018 20:39:47 +0000 (21:39 +0100)
Fixes #8189

rack-cors being called before the application router, it does not follow
the redirection, and we need a separate rule for /users/:username.

config/initializers/cors.rb

index 36d3663cb493e9303dea109dd4a2a15327419b6b..55f8c9c9193c8387770f1e62fdc2b4c1810b8710 100644 (file)
@@ -17,6 +17,10 @@ Rails.application.config.middleware.insert_before 0, Rack::Cors do
       headers: :any,
       methods: [:get],
       credentials: false
+    resource '/users/:username',
+      headers: :any,
+      methods: [:get],
+      credentials: false
     resource '/api/*',
       headers: :any,
       methods: [:post, :put, :delete, :get, :patch, :options],