Skip to content

Commit 41e2615

Browse files
committed
Remove rack_strip_client_ip middleware
This removes middleware that strips the Client-IP header from requests to prevent Rails from raising a "IpSpoofAttackError" exception. Removing this because it isn't needed, we are stripping the Client-IP header at the CDN level which should prevent this expection being raised anyway. If this header is being set else were in the request path, we should fix that instead of blindly stripping the header altogether. There is also a bug in the middleware, where it prevent previous middleware from receiving information from following middleware in the 'env' variable. This is because it creates a copy of env, which isn't returned to the calling middleware. This prevents middleware such as the prometheus exporter from functioning properly.
1 parent 0facb22 commit 41e2615

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ gem "govuk_personalisation"
1010
gem "govuk_publishing_components"
1111
gem "htmlentities"
1212
gem "plek"
13-
gem "rack_strip_client_ip"
1413
gem "rails-controller-testing"
1514
gem "rails-i18n"
1615
gem "rails_translation_manager"

Gemfile.lock

-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ GEM
235235
rack
236236
rack-test (2.0.2)
237237
rack (>= 1.3)
238-
rack_strip_client_ip (0.0.2)
239238
rails (7.0.4)
240239
actioncable (= 7.0.4)
241240
actionmailbox (= 7.0.4)
@@ -411,7 +410,6 @@ DEPENDENCIES
411410
mocha
412411
plek
413412
pry
414-
rack_strip_client_ip
415413
rails (= 7.0.4)
416414
rails-controller-testing
417415
rails-i18n

0 commit comments

Comments
 (0)