Skip to content

Conversation

@ClaytonPassmore
Copy link

What

Disable host authorization in development mode by setting permitted_hosts to an empty array.

In other words - this change allows any host to be used in development.

Why

Sinatra v4.1.0 added a new host_authorization setting, which by default restricts development hosts to .localhost and .test. This does not work for everyone!

For those of us not using one of these default hosts in development mode, loading the web dash results in a 403 "Host not permitted" error. This change resolves that problem.

Sinatra v4.1.0 added a new `host_authorization` setting, which by
default restricts development hosts to `.localhost` and `.test`. This
does not work for everyone!

This change allows any host to be used in development.
@jkowens
Copy link

jkowens commented Jun 13, 2025

I needed to disable host authorization for all environments, so I added this line to our config.ru:

DelayedJobWeb.set(:host_authorization, { permitted_hosts: [] })

Just posting in case it helps anyone else 😅

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