Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 9.0.59 #923

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/services/foreman_rh_cloud/cloud_request_forwarder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def prepare_request_opts(original_request, forward_payload, forward_params, cert
def prepare_forward_payload(original_request, controller_name)
forward_payload = original_request.request_parameters[controller_name]

forward_payload = original_request.raw_post.clone if original_request.post? && original_request.raw_post
forward_payload = original_request.raw_post.clone if (original_request.post? || original_request.patch?) && original_request.raw_post
forward_payload = original_request.body.read if original_request.put?

forward_payload = original_request.params.slice(:file, :metadata) if original_request.params[:file]
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_rh_cloud/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ForemanRhCloud
VERSION = '9.0.58'.freeze
VERSION = '9.0.59'.freeze
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "foreman_rh_cloud",
"version": "9.0.58",
"version": "9.0.59",
"description": "Inventory Upload =============",
"main": "index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ class CloudRequestForwarderTest < ActiveSupport::TestCase
end

test 'should forward patch payload' do
params = { 'pumpkin' => 'pie' }
post_data = 'Random PATCH data'
req = ActionDispatch::Request.new(
'REQUEST_URI' => '/foo/bar?baz=awesome',
'REQUEST_METHOD' => 'PATCH',
'rack.input' => ::Puma::NullIO.new,
'RAW_POST_DATA' => 'Random PATCH data',
"action_dispatch.request.path_parameters" => { :format => "json" },
"action_dispatch.request.request_parameters" => { 'vegetables' => params }
'RAW_POST_DATA' => post_data,
"action_dispatch.request.path_parameters" => { :format => "json" }
)
assert_equal params.to_json, @forwarder.prepare_forward_payload(req, 'vegetables')
assert_equal post_data, @forwarder.prepare_forward_payload(req, 'Random PATCH data')
end

test 'should forward file with metadata' do
Expand Down
Loading