Open
Description
Describe the bug
Sinatra 4.1.0 adds host authorization by default in development mode.
This means that if you use a non-default domain in development, you'll get a ‘Host not permitted’ error when trying to visit the Split dashboard.
- https://github.com/sinatra/sinatra/blob/main/CHANGELOG.md#410--2024-11-18
- Add
HostAuthorization
rack-protection middleware sinatra/sinatra#2053
To Reproduce
Steps to reproduce the behavior:
- Configure Split and mount the dashboard as usual (make sure that Sinatra >= 4.1.0 gets installed)
- Add a custom domain to the permitted hosts in Rails (for example
config.hosts << "127.0.0.1.nip.io:3000"
) - Visit
127.0.0.1.nip.io:3000/split
- You should see a
Host not permitted
error
Expected behavior
The host authorization middleware should probably be configurable through the Split configuration.
Additional context
This monkey patch is a workaround for the moment:
require 'split/dashboard'
class Split::Dashboard
set :host_authorization, { permitted_hosts: ["127.0.0.1.nip.io"] }
end
Metadata
Metadata
Assignees
Labels
No labels