From 555186af62cfd5b2d9b36622b8daa5f988acf38e Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 26 Sep 2019 10:25:25 -0400 Subject: [PATCH] Add CORS header for '/instances.json' --- src/instances.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/instances.cr b/src/instances.cr index 7a2cf25..62e84f5 100644 --- a/src/instances.cr +++ b/src/instances.cr @@ -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"