Send the request's ID back as X-Request-Id
check / check (push) Failing after 2s

A middleware right after chi's RequestID sets the X-Request-Id response
header from the ID RequestID stored in the request context, so every
response carries it and a client can quote it when reporting a problem.
README "Routes" says where the ID comes from.

Model: opus-5-5
This commit is contained in:
2026-10-04 08:31:17 +00:00
parent 3bcd032d37
commit afe4b3bb70
3 changed files with 21 additions and 0 deletions
+6
View File
@@ -137,6 +137,12 @@ path under `/v1/` answers 200, in maintenance mode too.
authentication with `metrics.username` and `metrics.password`. Answers: 200;
401 without them; 404 when they are not set, as the route then does not exist.
Every response carries an `X-Request-ID` header holding the request's ID, which
a client can quote when reporting a problem: the request's own `X-Request-ID`
when it sent one, as a reverse proxy in front of pixa may, otherwise one pixa
makes up from its host name, a random string chosen at startup and a counter.
pixa's log line for the request carries the same ID as `request_id`.
Both `POST` routes accept only a form that pixa's own page served: the page puts
a token in the form and sets a cookie to match, and a request without both is
refused with 403, so another site cannot submit the form from a visitor's