Skip to content

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Jun 19, 2025

Rack::Protection 4.1.0 has introduced new Rack::Protection::HostAuthorization [1]. This makes www.example.com host to be rejected. The easiest solution is to disable this check for the TestApp.

The permitted_hosts could be more elaborated, e.g. set :host_authorization, { permitted_hosts: [".example.com", "127.0.0.1"] } also helped. While it seems weird to me, the 127.0.0.1 needs to be included to pass the test in spec/session/current_url_spec.rb 🤷

I have also tested this PR against Sinatra / Rack::Protection 4.0.1 and the "unknown" :host_authorization does not seem to cause any troubles.

This should help address issues observed in #2811

Rack::Protection 4.1.0 has introduced new
`Rack::Protection::HostAuthorization` [[1]]. This makes `www.example.com`
host to be rejected. The easiest solution is to disable this check for
the TestApp.

[1]: sinatra/sinatra#2053
@simi simi changed the base branch from master to modernize-ci June 19, 2025 08:52
@simi simi merged commit bb36f5d into teamcapybara:modernize-ci Jun 19, 2025
@simi
Copy link
Contributor

simi commented Jun 19, 2025

Thanks, merged into the ci branch for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants