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

Add host_authorization setting for dev environment #3059

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Add host_authorization setting for dev environment #3059

merged 1 commit into from
Nov 20, 2024

Conversation

csutter
Copy link
Contributor

@csutter csutter commented Nov 20, 2024

Sinatra 4.1 ships with a breaking change that enables host allowlisting middleware in local development, which in turn breaks running Search API through GOV.UK Docker.

This adds an explicit permitted_hosts setting for the middleware in the development environment, which allows access with arbitrary host headers.

lib/rummager/config.rb Outdated Show resolved Hide resolved
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up - does look an annoying change. I've made a suggestion but not fully convinced we benefit from enabling the protection - I'm a bit confused why Sinatra applied it to dev when mostly an issue with reverse proxies.

lib/rummager/config.rb Outdated Show resolved Hide resolved
Sinatra 4.1 ships with a breaking change that [enables host allowlisting
middleware][1] in local development, which in turn breaks running Search
API through GOV.UK Docker.

This adds an explicit `permitted_hosts` setting for the middleware in
the development environment, which allows access with arbitrary host
headers.

[1]: sinatra/sinatra#2053
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@csutter csutter merged commit f4caed7 into main Nov 20, 2024
6 checks passed
@csutter csutter deleted the sin-dev branch November 20, 2024 17:01
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