#173: render friendly 'Paste ID not found' UI instead of bare 404
Missing/expired/burned paste IDs and unknown routes now render the main UI (topbar + centered result card) with a 'Paste ID not found' message, returning HTTP 404 status for correctness.
This commit is contained in:
@@ -129,9 +129,12 @@ func (a *apiServer) routes() http.Handler {
|
||||
r.Get("/{id}", a.handlePasteView)
|
||||
r.Post("/{id}", a.handlePasteView)
|
||||
|
||||
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
|
||||
writeErr(w, 404, "not found")
|
||||
})
|
||||
// #173: missing paste URLs render the main UI with a friendly not-found
|
||||
// message instead of a bare JSON 404. Known routes (above) handle real pages;
|
||||
// anything else is a nonexistent paste ID or typo.
|
||||
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
|
||||
a.webHandlers().HandleNotFoundPage(w, r)
|
||||
})
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user