Skip to content

Disable Sinatra's host_authorization by default #39

@postmodern

Description

@postmodern

Sinatra enables host_authorization in development mode by default. This can cause issues when testing apps, sending requests with no Host: header, sending requests with different Host: header than localhost, 0.0.0.0, etc. It might be safer to disable host_authorization by default.

If users wish to re-enable host_authorization, simply set host_authorization with permitted_hosts:

set :host_authorization, {permitted_hosts: %w[...]}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions