thecore_api 1.1.19 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4150ac295cc272aad66fe0144cc5fe7a675bd3eb
|
4
|
+
data.tar.gz: 964bf8967f023d225b7d634cf6ccbfa38fee2542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3df94866c03df4fb0aa822ec0ecfd83e349c9e3cb23d91ca4124adf0ee649ab09c34c927e52024a83b687b476ea7801311d0c7e3ac685b0563002c1b15b50026
|
7
|
+
data.tar.gz: 12efbcbef6f5ad1bf09081ab95beb773f40c19c73bb0ac4e05221e81b5ee06875c5138a1f551e39c690937f8d9e8fc936fd99b706062982bbd551e477a4a22fb
|
@@ -1,7 +1,15 @@
|
|
1
1
|
# config/initializers/cors.rb
|
2
2
|
Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
3
3
|
allow do
|
4
|
-
origins
|
4
|
+
origins { |source, env|
|
5
|
+
# No settings => '*'
|
6
|
+
allowed_origins = Settings.ns('api').allowed_origins
|
7
|
+
return true if allowed_origins.blank?
|
8
|
+
allowed_origins.split(",").each do |domain|
|
9
|
+
return true if source.end_with?(domain.strip)
|
10
|
+
end
|
11
|
+
return false
|
12
|
+
}
|
5
13
|
resource '*',
|
6
14
|
headers: :any,
|
7
15
|
methods: %i(get post put patch delete options head)
|
data/lib/thecore_api/version.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- config/initializers/cors_api_thecore.rb
|
97
97
|
- config/initializers/wrap_parameters.rb
|
98
98
|
- config/routes.rb
|
99
|
+
- db/migrate/20181120234856_add_allowed_origins_to_settings.rb
|
99
100
|
- lib/tasks/thecore_api_tasks.rake
|
100
101
|
- lib/thecore_api.rb
|
101
102
|
- lib/thecore_api/engine.rb
|
@@ -130,6 +131,7 @@ files:
|
|
130
131
|
- test/dummy/config/locales/en.yml
|
131
132
|
- test/dummy/config/routes.rb
|
132
133
|
- test/dummy/config/secrets.yml
|
134
|
+
- test/dummy/log/development.log
|
133
135
|
- test/dummy/public/404.html
|
134
136
|
- test/dummy/public/422.html
|
135
137
|
- test/dummy/public/500.html
|
@@ -177,6 +179,7 @@ test_files:
|
|
177
179
|
- test/dummy/public/favicon.ico
|
178
180
|
- test/dummy/public/422.html
|
179
181
|
- test/dummy/Rakefile
|
182
|
+
- test/dummy/log/development.log
|
180
183
|
- test/dummy/config.ru
|
181
184
|
- test/dummy/README.rdoc
|
182
185
|
- test/dummy/config/locales/en.yml
|