registry/internal/api
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Radoslav Dimitrov 5d736c7c6c
test(api): remove placeholder CORS test superseded by #1436 (#1441)
Follow-up to #1436.

`internal/api/cors_test.go` was a placeholder: both `TestCORSHeaders`
and `TestCORSHeaderValues` construct `api.NewServer(...)`, discard it,
and then assert against a locally-built `http.HandlerFunc` that has no
CORS middleware — so they never exercised the real stack.
`TestCORSHeaderValues` only `t.Log`s; `TestCORSHeaders`'s only real
assertion (preflight status in {200,204}) ran against a bare handler
that always returns 200. The comments admit as much ("this is a bit of a
hack", "verified via integration tests").

That empty coverage is exactly why the missing `PATCH` in the CORS
`AllowedMethods` (fixed in #1436) went unnoticed.

#1436 added `TestCORSPreflightAllowedMethods`, which drives the real
wrapped handler through the new `Server.Handler()` accessor and asserts
every routed method — including PATCH — is allowed. With that in place
the placeholder carries no remaining coverage, so this PR removes it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 15:18:39 -04:00
..
handlers/v0 docs(auth): document fine-grained PAT permission for org publishing (+ pagination-cap test) (#1435) 2026-07-10 18:48:56 -04:00
router metrics: stop counting client-cancelled requests as server errors (#1255) 2026-05-05 05:58:05 -04:00
cors_preflight_test.go fix(api): allow PATCH in CORS so browsers can call the status endpoints (#1436) 2026-07-12 21:53:13 +03:00
openapi_compliance_test.go Ensure tests are failing CI (#840) 2025-12-11 09:56:57 +02:00
server.go fix(api): allow PATCH in CORS so browsers can call the status endpoints (#1436) 2026-07-12 21:53:13 +03:00
server_test.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00