Validate submitted URL and reject malformed input #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.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.