Five of the HTTP middlewares have no tests of their own #69

Open
opened 2026-09-21 07:18:21 +00:00 by cgalo5758 · 0 comments
Owner

What a contributor runs into

The middleware package's tests cover the cross-origin check, request decompression, panic recovery and the security headers. Response compression, the cross-origin resource rules, request logging, the request id and the request timeout have none, so a change to any of them is covered only by whatever handler test happens to pass through it.

Why it costs

These are the pieces where a mistake is invisible in ordinary use and serious in production: a timeout that stops firing, a request id that stops being propagated into the logs, a compression path that corrupts a response for one content type. Nothing fails when one of them regresses.

Where

internal/middleware and its tests directory.

Done when

Each of the five has a test that drives it directly: what it adds to the request or the response, what it does when the wrapped handler fails, and what it does when the client asks for something it cannot provide.

Migrated from status/issues.md at b7a0e15

## What a contributor runs into The middleware package's tests cover the cross-origin check, request decompression, panic recovery and the security headers. Response compression, the cross-origin resource rules, request logging, the request id and the request timeout have none, so a change to any of them is covered only by whatever handler test happens to pass through it. ## Why it costs These are the pieces where a mistake is invisible in ordinary use and serious in production: a timeout that stops firing, a request id that stops being propagated into the logs, a compression path that corrupts a response for one content type. Nothing fails when one of them regresses. ## Where [`internal/middleware`](https://git.coopcloud.tech/wiki-cafe/member-console/src/commit/b7a0e15/internal/middleware) and its `tests` directory. ## Done when Each of the five has a test that drives it directly: what it adds to the request or the response, what it does when the wrapped handler fails, and what it does when the client asks for something it cannot provide. Migrated from status/issues.md at b7a0e15
cgalo5758 added the
kind
debt
area/testinggood-first-issue
labels 2026-09-21 07:18:21 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#69