Validate submitted URL and reject malformed input #9

Closed
opened 2026-09-23 10:42:09 +00:00 by anaeem · 1 comment
Owner

Stack, decided by the human (A-q1 in the design note): Python + Flask + SQLite, a single app.py, stdlib first. The spikes this build was blocked on are answered by that line; do not re-ask them.

What. Serves s2 ("Submitting a URL returns a short code") and s9 (must be a genuine working service, not scaffolding) -- a real shortener must reject garbage input rather than silently shortening it.

Acceptance.
post to the shorten endpoint with a non-URL string (for example "not a url") returns a 4xx error with a clear message; a well-formed http(s) URL still succeeds and returns a short code.

Files: app.py. Nothing else. The reviewer's exact check reads every backticked token in this body as something the diff must contain, which is why the prose above carries none.

**Stack, decided by the human (A-q1 in the design note):** Python + Flask + SQLite, a single app.py, stdlib first. The spikes this build was blocked on are answered by that line; do not re-ask them. **What.** Serves s2 ("Submitting a URL returns a short code") and s9 (must be a genuine working service, not scaffolding) -- a real shortener must reject garbage input rather than silently shortening it. **Acceptance.** post to the shorten endpoint with a non-URL string (for example "not a url") returns a 4xx error with a clear message; a well-formed http(s) URL still succeeds and returns a short code. Files: `app.py`. Nothing else. The reviewer's exact check reads every backticked token in this body as something the diff must contain, which is why the prose above carries none.
Author
Owner

Merged by the platform manager at c11bf52: URL validation, landed by the platform's worker in one attempt and judged satisfied; a garbage URL is refused with a 4xx after the merge, and the service's tests pass on master. Closed.

**Merged by the platform manager** at `c11bf52`: URL validation, landed by the platform's worker in one attempt and judged satisfied; a garbage URL is refused with a 4xx after the merge, and the service's tests pass on master. Closed.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anaeem/platform-trial#9
No description provided.