Project

General

Profile

Bug #18958

UnattendedController test sets multiple remote IPs incorrectly in REMOTE_ADDR

Added by Dominic Cleal over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

The test "UnattendedControllerTest#test_0006_should get a preseed finish script with multiple ips in the request header" sets up multiple remote IPs in REMOTE_ADDR with:

@request.env["REMOTE_ADDR"] = [@ub_host.ip, '1.2.3.4']

however environment variables should be only strings, not complex objects (an array). This may cause an issue if request.ip is called from a controller or library, as rack will attempt to split the string:

https://github.com/rack/rack/blob/2.0.1/lib/rack/request.rb#L257
https://github.com/rack/rack/blob/2.0.1/lib/rack/request.rb#L476

(seen during modifications to audited, which records request IP addresses by calling request.ip)

Associated revisions

Revision 24f52ce5 (diff)
Added by Dominic Cleal over 4 years ago

fixes #18958 - correct format of multiple REMOTE_ADDR addresses

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4391 added

#2 Updated by Dominic Cleal over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Ohad Levy over 4 years ago

  • Legacy Backlogs Release (now unused) set to 209

Also available in: Atom PDF