Skip to content

Commit

Permalink
Added Rack 3.1 to the list of Rack versions we test against.
Browse files Browse the repository at this point in the history
  • Loading branch information
baldowl committed Jun 11, 2024
1 parent cab135d commit 7467559
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ workflows:
matrix:
parameters:
ruby_version: ["3.1", "3.2", "3.3"]
rack_version: ["2.2.0", "3.0.0"]
rack_version: ["2.2.0", "3.0.0", "3.1.0"]
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
rack_version:
- "2.2.0"
- "3.0.0"
- "3.1.0"
name: Ruby ~> ${{ matrix.ruby_version }}; Rack ~> ${{ matrix.rack_version }}
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 1 addition & 1 deletion features/skip_some_routes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Feature: Skipping the check for some specific routes
| PUT | /this/one/too |
| DELETE | /this/one/too |

Scenario Outline: Handling correctly empty PATH_INFO
Scenario Outline: Handling correctly empty PATH_INFO when using Rack 3.0 and earlier
Given a rack with the anti-CSRF middleware and the :skip option
| pair |
| POST:/ |
Expand Down
4 changes: 3 additions & 1 deletion features/step_definitions/request_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@
end
end

# Rack 3.1 changed spec so that now PATH_INFO cannot be empty. Below we cheat
# a bit and change PATH_INFO when using Rack 3.1+
When /^it receives a (.*) request with neither PATH_INFO nor CSRF token or header$/ do |http_method|
begin
@browser.request '/doesntmatter', :method => http_method, 'PATH_INFO' => ''
@browser.request '/doesntmatter', :method => http_method, 'PATH_INFO' => (Rack.release >= '3.1.0' ? '/' : '')
rescue StandardError => e
@exception = e
end
Expand Down

0 comments on commit 7467559

Please sign in to comment.