Add CORS header for '/instances.json'

This commit is contained in:
Omar Roth 2019-09-26 10:25:25 -04:00
parent 5a7ba726c9
commit 555186af62
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2

View file

@ -103,7 +103,9 @@ get "/" do |env|
end
get "/instances.json" do |env|
env.response.headers["Access-Control-Allow-Origin"] = "*"
env.response.content_type = "application/json; charset=utf-8"
sort_by = env.params.query["sort_by"]?
sort_by ||= "users"