Class: HealthController
- Inherits:
-
Rails::HealthController
- Object
- Rails::HealthController
- HealthController
- Defined in:
- app/controllers/health_controller.rb
Overview
Accept-agnostic health-check endpoint mounted at GET /up.
Replaces Rails::HealthController on this route. Rails' built-in
controller negotiates via respond_to with format.html / format.json
only, so probes that send unusual Accept headers (e.g.
application/octet-stream) raise ActionController::UnknownFormat —
both in render_up and inside the rescue_from(Exception) handler that
delegates to render_down. The secondary raise from render_down
bubbles up uncaught, producing a noisy 500 with a stack trace instead
of a tiny boot-status reply.
We override render_up and render_down to use head :ok /
head :internal_server_error. No respond_to runs, so the response
body is empty and Rack picks a Content-Type without ever consulting
the request's Accept header. Status semantics (200 healthy / 500 boot
exception) are preserved by the parent's rescue_from(Exception).