Skip to content

Commit

Permalink
cleanup(API): RHINENG-15696 remove comensation for branch_id parameter
Browse files Browse the repository at this point in the history
  parameter has been excluded in
  theforeman/foreman_rh_cloud@792a0d1
  • Loading branch information
romanblanco committed Mar 4, 2025
1 parent 3dcc54a commit d7833ae
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/insights/api/common/satellite_compensation/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ def initialize(app)
end

def call(env)
if env['HTTP_USER_AGENT'] =~ /foreman|satellite/i
if env['HTTP_USER_AGENT'] =~ /foreman|satellite/i && env['CONTENT_TYPE'] == ''
# Sometimes Satellite forwards the client requests with an empty string
# as content-type and Rails does not like it.
env['CONTENT_TYPE'] = nil if env['CONTENT_TYPE'] == ''

# There is an additional branch_id parameter coming from Satellite that
# fails on the stricter checking of params in our REST API.
Rack::Request.new(env).delete_param('branch_id')
env['CONTENT_TYPE'] = nil

Check warning on line 18 in lib/insights/api/common/satellite_compensation/middleware.rb

View check run for this annotation

Codecov / codecov/patch

lib/insights/api/common/satellite_compensation/middleware.rb#L18

Added line #L18 was not covered by tests
end

@app.call(env)
Expand Down

0 comments on commit d7833ae

Please sign in to comment.