Skip to content

[Bug Fix] Allow non-localhost hosts in docs development env#455

Merged
djalmaaraujo merged 1 commit into
mainfrom
fix/dev-host-authorization
Jul 1, 2026
Merged

[Bug Fix] Allow non-localhost hosts in docs development env#455
djalmaaraujo merged 1 commit into
mainfrom
fix/dev-host-authorization

Conversation

@djalmaaraujo

@djalmaaraujo djalmaaraujo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rails 8's Host Authorization middleware only allows localhost/private IPs by default, so opening the docs dev server through a VM hostname or Tailscale domain gets rejected with "Blocked hosts".
  • Clears config.hosts in docs/config/environments/development.rb — development-only, does not affect production.

Test plan

  • Ran bin/rails server -b 0.0.0.0 -p 3000 inside the docs devcontainer
  • Confirmed a request with Host: devmachine.cloud:3001 returns 200 (previously blocked)
  • Confirmed localhost still works as before

Summary by cubic

Fix docs dev server host blocking by clearing config.hosts in development. This allows access via VM hostnames, tunnels, or Tailscale domains (not just localhost) and has no production impact.

Written for commit a91e550. Summary will update on new commits.

Review in cubic

Rails 8's Host Authorization middleware blocks any Host header outside
localhost/private IPs by default, so accessing the docs dev server
through a VM hostname or Tailscale domain (e.g. devmachine.cloud) gets
rejected with "Blocked hosts". Clear config.hosts in development since
this is a non-public dev-only environment.
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner July 1, 2026 03:36

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@djalmaaraujo djalmaaraujo merged commit 87ac47e into main Jul 1, 2026
8 checks passed
@djalmaaraujo djalmaaraujo deleted the fix/dev-host-authorization branch July 1, 2026 03:38
@djalmaaraujo djalmaaraujo mentioned this pull request Jul 1, 2026
3 tasks
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.

1 participant