Skip to content

Commit 4add1ad

Browse files
committed
RackParsingOverride: check base_label
Otherwise it fails on Ruby 3.4 because `label` now contains the module name.
1 parent 17184bd commit 4add1ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

actionpack/test/support/rack_parsing_override.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ module RequestPatch
3535
def self.permitted_caller?
3636
caller_locations.any? do |loc|
3737
# Our parser calls Rack's to prepopulate caches
38-
loc.path.end_with?("lib/action_dispatch/http/request.rb") && loc.label == "request_parameters_list" ||
38+
loc.path.end_with?("lib/action_dispatch/http/request.rb") && loc.base_label == "request_parameters_list" ||
3939
# and as a fallback for older Rack versions
40-
loc.path.end_with?("lib/action_dispatch/http/request.rb") && loc.label == "fallback_request_parameters" ||
40+
loc.path.end_with?("lib/action_dispatch/http/request.rb") && loc.base_label == "fallback_request_parameters" ||
4141
# This specifically tests that a "pure" Rack middleware
4242
# doesn't interfere with our parsing
43-
(loc.path.end_with?("test/dispatch/request/query_string_parsing_test.rb") && loc.label == "populate_rack_cache") ||
43+
(loc.path.end_with?("test/dispatch/request/query_string_parsing_test.rb") && loc.base_label == "populate_rack_cache") ||
4444
# Rack::MethodOverride obviously uses Rack's parsing, and
4545
# that's fine: it's looking for a simple top-level key.
4646
# Checking for a specific internal method is fragile, but we
4747
# don't want to ignore any app that happens to have
4848
# MethodOverride on its call stack!
49-
(loc.path.end_with?("lib/rack/method_override.rb") && loc.label == "method_override_param")
49+
(loc.path.end_with?("lib/rack/method_override.rb") && loc.base_label == "method_override_param")
5050
end
5151
end
5252

0 commit comments

Comments
 (0)