foreman_rh_cloud 4.0.30 → 4.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: d30780fe6dc3c0b25146d8c8b5549179516218ebbf8cfcaa02aa704ee24d9f62
4
- data.tar.gz: 3a0c1d673a773487565e26493f34fe88dd91f5b7a27f15fa6b532b8ef7a2eb58
3
+ metadata.gz: e14db9e6999496bcfba315a4cd476131e102c9694b479f8208938f021633c132
4
+ data.tar.gz: 74742e367059aa5b6e68aaae1eaf16a0de2f9df9e981215a070768654517e51b
5
5
  SHA512:
6
- metadata.gz: 80e8f58e6cb5572796af39e096163f151fa1636b92064ab239f16fc439dee10e25c6cf7be17f046670424dcdf2c799fcc497be964585e96ef51070154fe6c6a6
7
- data.tar.gz: 3233f24be9b101917d12367e6649edf96e52e705db61de109f04a82ac13369018dbdca536bd2b400ed56a23971aaeceb04905b18f80220f8fe702181403c941b
6
+ metadata.gz: f89a0c377c341f85b3568e47a7939233c6ab0ad6b4455ea7774b8d4a1359da1b34b718b2e96d00ae30577e350aafd130e052cee73100094672e69764137d3022
7
+ data.tar.gz: 79969dfbae771637006974db3663d8d86804d4cb2b6056bbacbdaeb21b8d72ee15c34654ade1c0efa14aa6b955973f9ce33401b6ab8bafbcf764cc30882f6a76
@@ -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 = '4.0.30'.freeze
2
+ VERSION = '4.0.31'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "4.0.30",
3
+ "version": "4.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
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: 4.0.30
4
+ version: 4.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