Browse Source

fixed 修改跨域方式

pull/309/head
“xxq250” 3 years ago
parent
commit
cb0112fde8
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      config/application.rb

+ 3
- 2
config/application.rb View File

@@ -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


Loading…
Cancel
Save