Set CORS headers for all .well-known responses
continuous-integration/drone/push Build is passing

So we don't have to consider it for reverse proxies etc.
This commit is contained in:
2024-09-10 16:06:11 +02:00
parent 45137e0cfe
commit af3da0a26c
4 changed files with 21 additions and 9 deletions
+1 -9
View File
@@ -1,8 +1,6 @@
class WebfingerController < ApplicationController
class WebfingerController < WellKnownController
before_action :allow_cross_origin_requests, only: [:show]
layout false
def show
resource = params[:resource]
@@ -91,10 +89,4 @@ class WebfingerController < ApplicationController
}
}
end
def allow_cross_origin_requests
return unless Rails.env.development?
headers['Access-Control-Allow-Origin'] = "*"
headers['Access-Control-Allow-Methods'] = "GET"
end
end