Nobody has started this yet — be first.
Business impact
Anyone saving a plain http:// link -- an internal tool, an old blog, a local dev server -- gets a hard 400, even though the API's own documented contract ("url must use http or https") promises both are supported. This reads as a broken product for the (still common) case of non-https pages.
Problem
validateURL now rejects every scheme except https. The error message it returns still claims both are accepted, which is actively misleading.
Current behavior
POST /bookmarks with a http:// URL returns 400 "url must use http or https", even though http:// is exactly one of the two schemes that message says are accepted.
Expected behavior
Both http:// and https:// are accepted; every other rejection (empty URL, relative path, other schemes, no host) is unchanged.
Steps to reproduce
curl -s -X POST http://localhost:8081/bookmarks -H 'Content-Type: application/json'
-d '{"url":"http://intranet.local/wiki","title":"Internal wiki"}'
Why this matters
A two-branch scheme check lost one branch -- most plausibly a partial edit toward an https-only policy that never finished. It compiles and passes every existing test cleanly because none of them happen to POST an http:// URL.
Suggested approach
Compare the scheme check in validateURL against its own doc comment two lines above, which still describes accepting "http(s)".
Acceptance criteria
Verification
go test ./practicetickets/... -run TestTicket03 -v
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
$git checkout -b fix/http-scheme-rejectedFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/http-scheme-rejectedSubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign inmigrations/0001_init.sqlcurl http://localhost:8081/healthz
# {"status":"ok"}
To run without Docker, point the DB_* env vars from .env.example at a reachable Postgres and run go run ./cmd/server -- it applies the same migrations on startup.
The project's own test suite (go test ./...) is an integration suite against a real Postgres; it looks for one via BM_TEST_DB_HOST/BM_TEST_DB_PORT/BM_TEST_DB_USER/BM_TEST_DB_PASSWORD/BM_TEST_DB_NAME (defaults point at localhost:15433, database bookmarks_test) and skips cleanly rather than failing if that database is unreachable:
docker run -d --name bm_test_pg -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=bookmarks_test -p 15433:5432 postgres:16-alpine
Work the tickets in PRACTICE_TICKETS.md (TICKET-01 through TICKET-10, all in one file, ordered easy -> hard); each names one Go test under practicetickets/:
go test ./practicetickets/... -run TestTicket01 -v # a single ticket
./practice_tickets_run.sh # all 10, clean pass/fail summary table
Level 1
Fix a bug
Read existing behaviour, correct it.