Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sinatra now requires Host Authorization #203

Open
etc opened this issue Jan 16, 2025 · 1 comment
Open

Sinatra now requires Host Authorization #203

etc opened this issue Jan 16, 2025 · 1 comment

Comments

@etc
Copy link

etc commented Jan 16, 2025

As of Nesta 0.18.0, sites require the line set :host_authorization, { permitted_hosts: [] } (or something along those lines) to be added to app.rb in themes. If they do not do this, they generate a Host not permitted error when trying to access the site. This doesn't happen running locally; only when deployed. See here for the same error in a different context.

See here for documentation of host_authorization in Sinatra, and here for one way to handle this depending on whether in development or production environments. This way of handling it seems like it would be good to implement in Nesta itself, rather than by hand in themes.

@gma
Copy link
Owner

gma commented Jan 18, 2025

@etc Hi Brad. I've just tried running one of my sites that's on 0.18.0 (with Sinatra 4.1.0) on Puma in the production environment, and it seems fine with no modifications.

From the docs, I'm surprised it's introduced problems as they say permitted_hosts defaults to [] in production.

Any chance I could get a look at your theme's code so I can reproduce this, then find the right fix?

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

No branches or pull requests

2 participants