Commit Graph
6 Commits
Author SHA1 Message Date
claudeandClaude Sonnet 5 68546badb3 reject non-3xx status codes; close the CSV file; add tests
CI / go-tests (pull_request) Successful in 2m4s
A row with a status code outside 3xx (e.g. "0" from a typo) was accepted
at load and then panicked net/http's WriteHeader on the first matching
request. ReadCsvRedirects now rejects anything that isn't 300-399, with a
line number in the message, and reports a non-numeric code clearly.

Also defer reader.Close() (the file was left open for the process
lifetime) and drop the unreachable "row == nil" check.

Adds internal/{csv,redirect,http}_test.go covering CSV parsing (valid,
reordered headings, header-only, missing heading, non-numeric and non-3xx
status, ragged row, missing file), Redirects.Find / Redirect.Match, and
ServeHTTP (redirect, 404, query string dropped).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 14:19:44 +01:00
aneurin 1dfa60a237 Add Gitea CI/CD workflows and Dockerfile (#1)
Build / build-and-push (push) Successful in 1m34s
Co-authored-by: Aneurin Barker Snook <aneurin@aneur.in>
2026-09-06 22:23:12 +00:00
aneurin 3bfb73d3b9 fix unsent header 2026-03-30 22:04:50 +01:00
aneurin 31d0e05dfd add readme 2026-03-30 21:51:48 +01:00
aneurin a98ef28055 add csv reading, routing 2026-03-30 21:42:52 +01:00
aneurin 153dc64f60 initial commit with basic http server 2026-03-30 17:38:09 +01:00