foreman_theme_satellite 16.2.2 → 16.2.3

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: bb170b54611ff66c807f9a005cc4d79c809455d58c61b19eb0d6d4db4f7e032e
4
- data.tar.gz: 9d743b450a38a85ea7f0d27ca6459c89aabfeb7f61f5a9326154a00776f0199d
3
+ metadata.gz: fd0c1305a2c1882e04ee4b40116e191ec6caa8e370bb1b63ba442ae06fde7cd4
4
+ data.tar.gz: 81553069ec7e9f6a6f40f44bd248bf4ef657d17e86b6b1580f3b0b0a6b7ad27d
5
5
  SHA512:
6
- metadata.gz: 18531434b04e89d40931779aab1f90f67d67aa4e98b97eb45bd27948398f122a28a259ff946d61c7e9433fc608bfba32ca9b7016dcea3c914afb9da4b6387db2
7
- data.tar.gz: 2a745ad5d456dabbf10963153d2a17dc5349f4c5fe65539be03ccbf513901fe23e971ef368d5dc6a33365003af7c8fa692617921ca28255297ab04d8ebf28c26
6
+ metadata.gz: c7171bce12fdc61378153f6a9a8c86dc5b03a82140cbe7456f097bd7bc23342182380ca965254c8a5d26508169ffb3db47814c1f0eaa9bc798c938c93d79eed8
7
+ data.tar.gz: 14f56bc96f0b3e27d0d2793ee30ceafe2ed3880343a286f7e643fa93f1bf4ca953b2300b93c62822fdc2753766a118dfa32f08ce02da0224944f3feec0d25f37
@@ -13,7 +13,7 @@ module DocumentationControllerBranding
13
13
  if url.empty?
14
14
  upstream_url = super(section, options)
15
15
  url = if (upstream_url =~ /redhat.com/)
16
- upstream_url
16
+ redirect_root_url(upstream_url)
17
17
  else
18
18
  documentation_root_url
19
19
  end
@@ -62,5 +62,20 @@ module DocumentationControllerBranding
62
62
  def unversioned_documentation_root
63
63
  "#{Setting[:satellite_documentation_url]}/documentation/en-us/red_hat_satellite"
64
64
  end
65
+
66
+ private
67
+
68
+ def redirect_root_url(upstream_url)
69
+ docs_url_setting = Foreman.settings.find(:satellite_documentation_url)
70
+ return upstream_url if docs_url_setting.value == docs_url_setting.default
71
+
72
+ upstream_uri = URI.parse(upstream_url)
73
+ default_host = URI.parse(docs_url_setting.default).host
74
+ return upstream_url unless upstream_uri.host == default_host
75
+
76
+ downstream_uri = URI.parse(Setting[:satellite_documentation_url])
77
+ downstream_uri.path += upstream_uri.path
78
+ downstream_uri.to_s
79
+ end
65
80
  # rubocop:enable Lint/UnusedMethodArgument
66
81
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanThemeSatellite
2
- VERSION = '16.2.2'.freeze
2
+ VERSION = '16.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_theme_satellite
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.2.2
4
+ version: 16.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shimon Stein