允许跨域请求白名单IP
This commit is contained in:
parent
5519c9c51a
commit
9b0581831f
|
@ -41,7 +41,7 @@ module Gitlink
|
||||||
config.middleware.insert_before 0, Rack::Cors do
|
config.middleware.insert_before 0, Rack::Cors do
|
||||||
allow do
|
allow do
|
||||||
# origins '*'
|
# origins '*'
|
||||||
origins /http:\/\/localhost(:\d+)?\z/, /^(http|https):\/\/(.*(gitlink.org.cn))$/, /^(http|https):\/\/(.*(trustie.net))$/
|
origins /http:\/\/localhost(:\d+)?\z/, /http:\/\/172.20.32.201(:\d+)?\z/, /http:\/\/172.20.32.202(:\d+)?\z/, /^(http|https):\/\/(.*(gitlink.org.cn))$/, /^(http|https):\/\/(.*(trustie.net))$/
|
||||||
# location of your api
|
# location of your api
|
||||||
resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put, :patch], credentials: true
|
resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put, :patch], credentials: true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue