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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fd0c1305a2c1882e04ee4b40116e191ec6caa8e370bb1b63ba442ae06fde7cd4
|
|
4
|
+
data.tar.gz: 81553069ec7e9f6a6f40f44bd248bf4ef657d17e86b6b1580f3b0b0a6b7ad27d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|