rails_multisite 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c423a9ad1f1506b7278fdad487f740236f6241a5cfced260e135cc4392f0f24d
4
- data.tar.gz: 3da1e820fedb5a8ec1c7c34c41668cf62d8891bab765f554e54186688fe27464
3
+ metadata.gz: e38f660f7fbb4a5505adeb4d46f73a02f290cc65f9f566a03fc4fc7051e68392
4
+ data.tar.gz: 90242e454a09c2faed90d8561ac6b3de61c0d723344ac107e1fc89e23c20f0cd
5
5
  SHA512:
6
- metadata.gz: 68717b4c14ccf6586de353e1e455aa948e931a498fcb5816008f5f6655e6d8c896793ef635532cc056073f917f7ea6e7205e7f5bc9b4a5a581e574cee76cd47b
7
- data.tar.gz: 68779aedd6acb814e8401226ef67ad9636abf3ca71c954cef89226199fd754a34f78c84c5340af2bc2216f9e560d410867837a3fd3d221c53b08449ed60ceb68
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.asset_hostname`
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.asset_hostname = 'assets.example.com'`
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.asset_hostname
39
- @asset_hostname
38
+ def self.asset_hostnames
39
+ @asset_hostnames
40
40
  end
41
41
 
42
- def self.asset_hostname=(h)
43
- @asset_hostname = h
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'] && request.host == self.class.asset_hostname
383
+ if request['__ws'] && self.class.asset_hostnames&.include?(request.host)
384
384
  request.cookies.clear
385
385
  request['__ws']
386
386
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  module RailsMultisite
4
- VERSION = "2.4.0"
4
+ VERSION = "2.5.0"
5
5
  end
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.0
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-15 00:00:00.000000000 Z
11
+ date: 2020-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord