Skip to content

Conversation

ajitdsa
Copy link

@ajitdsa ajitdsa commented Sep 30, 2025

This PR makes Liteboard Rack 3–compliant in development by fixing response headers and default handlers. Minor infra tweak aligned with our ongoing SQLite-first litestack work.

Changes

  • Lowercase response headers to satisfy Rack 3 Lint (Cache-Control → cache-control) and add explicit content-type for HTML responses, via Liteboard#after.
  • Driveby: Add an explicit /favicon.ico route returning 204 No Content to stop repeated browser requests and ensure a valid Rack triplet.
  • Driveby: Introduce a default 404 handler for unmatched routes so every path returns a proper [status, headers, body] response.
  • Net change: 1 deletion, 5 additions in lib/litestack/liteboard/liteboard.rb; commit e33e566 by @ajitdsa on Sep 30, 2025.

Testing

  • Manual repro documented in commit: run liteboard with development DB and visit “/” and “/favicon.ico”; after change, both routes return valid responses with no Rack::Lint or TempfileReaper errors.
  • No automated tests are included in this PR.

…avicon handlers

- Return lowercase response headers and explicit content-type from Liteboard#after
  to satisfy Rack 3 Lint (Cache-Control → cache-control).
- Add explicit /favicon.ico handler returning 204 No Content to avoid repeated
  browser requests and ensure a valid Rack triplet.
- Add default 404 handler for unmatched routes so every request path returns a
  proper [status, headers, body] response.

This resolves errors seen in development with Rack 3:
- Rack::Lint::LintError: uppercase character in header name: Cache-Control
- NoMethodError in Rack::TempfileReaper when an unmatched path returned nil.

Repro:
  liteboard -d db/development.sqlite3 --env=development
  Visit "/" and "/favicon.ico"

Issue:
  Loading liteboard in development gave the following error:
  `Rack::Lint::LintError: uppercase character in header name: Cache-Control (Rack::Lint::LintError)`
  Also, there was no handler for favicon.ico, so I added one.

After:
  Both routes return valid responses; no Rack::Lint or TempfileReaper errors.
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