Skip to content

Commit 8b6fb24

Browse files
committed
cleanup(API): RHINENG-15696 remove comensation for branch_id parameter
parameter has been excluded in theforeman/foreman_rh_cloud@792a0d1
1 parent 14e1a38 commit 8b6fb24

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ def initialize(app)
1212
end
1313

1414
def call(env)
15-
if env['HTTP_USER_AGENT'] =~ /foreman|satellite/i
15+
if env['HTTP_USER_AGENT'] =~ /foreman|satellite/i && env['CONTENT_TYPE'] == ''
1616
# Sometimes Satellite forwards the client requests with an empty string
1717
# as content-type and Rails does not like it.
18-
env['CONTENT_TYPE'] = nil if env['CONTENT_TYPE'] == ''
19-
20-
# There is an additional branch_id parameter coming from Satellite that
21-
# fails on the stricter checking of params in our REST API.
22-
Rack::Request.new(env).delete_param('branch_id')
18+
env['CONTENT_TYPE'] = nil
2319
end
2420

2521
@app.call(env)

0 commit comments

Comments
 (0)