Skip to main content

Module page

Module page 

Source
Expand description

The HTML page rws shows a browser for its own errors (18.37.0): 404, 502, 503, maintenance and the rest. One self-contained template (inline CSS, light and dark, a title, the status, one sentence, a link home) in the look of the directory listing.

API clients are unchanged: negotiated turns an application/problem+json response into this page only when the request’s Accept prefers text/html (a browser navigation). Under a Content-Security-Policy that forbids inline styles the page still reads, unstyled.

Functions§

html
The page for status/reason; detail picks the sentence ("maintenance") and is otherwise not shown (it may be technical).
maintenance_message
[maintenance] message (RWS_CONFIG_MAINTENANCE_MESSAGE), or the default.
maintenance_retry_after
Retry-After seconds sent with maintenance responses (RWS_CONFIG_MAINTENANCE_RETRY_AFTER_SECS, default 120; 0 sends none).
negotiated
response as the HTML page when it is an rws-made problem details response (application/problem+json) and request prefers HTML; otherwise unchanged.
wants_html
Whether the request prefers HTML: Accept lists text/html (not with q=0) ahead of any JSON type. */* alone (fetch, curl) is not HTML.