rails_multisite 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_multisite might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/rails_multisite/connection_management.rb +5 -5
- data/lib/rails_multisite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e38f660f7fbb4a5505adeb4d46f73a02f290cc65f9f566a03fc4fc7051e68392
|
4
|
+
data.tar.gz: 90242e454a09c2faed90d8561ac6b3de61c0d723344ac107e1fc89e23c20f0cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a9bccdd03ddb205a20325ed127cc0e40b6e7c790147334ac9154350f5bc802e0462893541a39ab1ac0c54939d3cabadd7af455af5c779b882d93d5a4b5e4037
|
7
|
+
data.tar.gz: 7b0065714791944b3cabf2673f93a18277ec2cc721d85e8b5609ab94b7ff5928f8adf1500219aad4f659c27f5774e465739960c5a84468d6a0759ac07862c43b
|
data/README.md
CHANGED
@@ -95,7 +95,7 @@ RAILS_DB=db_one rails console
|
|
95
95
|
|
96
96
|
### CDN origin support
|
97
97
|
|
98
|
-
To avoid needing to configure many origins you can consider using `RailsMultisite::ConnectionManagement.
|
98
|
+
To avoid needing to configure many origins you can consider using `RailsMultisite::ConnectionManagement.asset_hostnames`
|
99
99
|
|
100
100
|
When configured, requests to `asset_hostname`?__ws=another.host.name will be re-routed to the correct site. Cookies will
|
101
101
|
be stripped on all incoming requests.
|
@@ -103,7 +103,7 @@ be stripped on all incoming requests.
|
|
103
103
|
Example:
|
104
104
|
|
105
105
|
- Multisite serves `sub.example.com` and `assets.example.com`
|
106
|
-
- `RailsMultisite::ConnectionManagement.
|
106
|
+
- `RailsMultisite::ConnectionManagement.asset_hostnames = ['assets.example.com']`
|
107
107
|
- Requests to `https://assets.example.com/route/?__ws=sub.example.com` will be routed to the `sub.example.com`
|
108
108
|
|
109
109
|
|
@@ -35,12 +35,12 @@ module RailsMultisite
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.
|
39
|
-
@
|
38
|
+
def self.asset_hostnames
|
39
|
+
@asset_hostnames
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.
|
43
|
-
@
|
42
|
+
def self.asset_hostnames=(h)
|
43
|
+
@asset_hostnames = h
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.config_filename
|
@@ -380,7 +380,7 @@ module RailsMultisite
|
|
380
380
|
request = Rack::Request.new(env)
|
381
381
|
|
382
382
|
host =
|
383
|
-
if request['__ws'] &&
|
383
|
+
if request['__ws'] && self.class.asset_hostnames&.include?(request.host)
|
384
384
|
request.cookies.clear
|
385
385
|
request['__ws']
|
386
386
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_multisite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|