foreman_rh_cloud 5.0.30 → 5.0.31

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
  SHA256:
3
- metadata.gz: 652e5780da34877a7db2beabee9d7853df3e92d56e9336b135c2f5c10e591135
4
- data.tar.gz: 41d79413f8cda24474d233512b75b301277058fec819cd0d8eb19c7ea24465b7
3
+ metadata.gz: 5de242348c67166e20efabc42ca1c4f1db9728fa456f17b2acdd8943df685e88
4
+ data.tar.gz: 6077615ad33a58f582e1c0f16e85df6b0c50b58d1956415d90be37bb236b3aee
5
5
  SHA512:
6
- metadata.gz: 5f570c0fce387859fb5cd268452591bf7ab85033600571aa0953173ab2d906bcfc22f5f2dbba5868d88c7af86a4442a4c56b45e719c8f0c0f983a14f039a2b27
7
- data.tar.gz: faa24509c2c3f8ef000c41bbbc0cddbc5352dc50998345883030b904d251cf8ee705a635caaf8ca3e9c84be38f188d529e60d5435dd506b76a7dac0a419e89db
6
+ metadata.gz: b30c352883db5a9100846d9eb3e0fec08853706129d3ddf7d1faef8e5d825345faa4c11240e3afd61e5d422100a1691fafc7564a43a8e09ecf9849377a0a1a75
7
+ data.tar.gz: 1aa622b93f13b5a938ae3ab7680967e9f677f0b421358e5c1f3400e77e3f26f8f45f0bac44b2c312793c72705863afb19c2515e982402a517cdac8acd62e057e
@@ -28,7 +28,7 @@ module ForemanRhCloud
28
28
  headers: {
29
29
  params: forward_params,
30
30
  user_agent: http_user_agent(original_request),
31
- content_type: original_request.media_type,
31
+ content_type: original_request.media_type.presence || original_request.format.to_s,
32
32
  },
33
33
  }
34
34
  base_params.merge(path_params(original_request.path, certs))
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '5.0.30'.freeze
2
+ VERSION = '5.0.31'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "5.0.30",
3
+ "version": "5.0.31",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -133,4 +133,23 @@ class CloudRequestForwarderTest < ActiveSupport::TestCase
133
133
  assert_equal 'GET', actual[:method]
134
134
  assert_equal params, actual[:headers][:params]
135
135
  end
136
+
137
+ test 'should forward content type correctly' do
138
+ user_agent = { :foo => :bar }
139
+ params = { :page => 5, :per_page => 42 }
140
+ ForemanRhCloud::BranchInfo.any_instance.expects(:core_app_name).returns('test_app')
141
+ ForemanRhCloud::BranchInfo.any_instance.expects(:core_app_version).returns('test_ver')
142
+
143
+ req = ActionDispatch::Request.new(
144
+ 'REQUEST_URI' => '/foo/bar',
145
+ 'REQUEST_METHOD' => 'GET',
146
+ 'HTTP_USER_AGENT' => user_agent,
147
+ 'rack.input' => ::Puma::NullIO.new,
148
+ 'action_dispatch.request.query_parameters' => params
149
+ )
150
+
151
+ actual = @forwarder.prepare_request_opts(req, 'TEST PAYLOAD', params, generate_certs_hash)
152
+
153
+ assert_match /text\/html/, actual[:headers][:content_type]
154
+ end
136
155
  end
@@ -25,7 +25,7 @@ const InsightsTotalRiskCard = ({ hostDetails: { id } }) => {
25
25
  } = useAPI('get', insightsCloudUrl(`hits/${id}`), API_OPTIONS);
26
26
 
27
27
  useEffect(() => {
28
- if (status !== STATUS.PENDING) {
28
+ if (status === STATUS.RESOLVED) {
29
29
  const risks = getInitialRisks();
30
30
  hits.forEach(({ total_risk: risk }) => {
31
31
  risks[risk].value += 1;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.30
4
+ version: 5.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello