From cb0112fde87372f18213a7e7e972da4eac8cc202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 19 Jul 2022 17:58:52 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BF=AE=E6=94=B9=E8=B7=A8=E5=9F=9F?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index 9589ee9be..709362389 100644 --- a/config/application.rb +++ b/config/application.rb @@ -40,9 +40,10 @@ module Gitlink config.middleware.insert_before 0, Rack::Cors do allow do - origins '*' + # origins '*' + origins /http:\/\/localhost(:\d+)?\z/, /^(http|https):\/\/(.*(gitlink.org.cn))$/ # location of your api - resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put, :patch] + resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put], credentials: true end end end