cmd/web: fix rendering blank page when submitting paste

Turns out the response code I want is HTTP 303 See Other[1].

[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303

Signed-off-by: Xe Iaso <xe@tailscale.com>
This commit is contained in:
Xe Iaso 2023-02-23 16:54:14 +00:00
parent 4e3a9a3757
commit a57f40cab1

View file

@ -208,7 +208,7 @@ VALUES
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "https://%s/paste/%s", s.httpsURL, id)
default:
http.Redirect(w, r, fmt.Sprintf("https://%s/paste/%s", s.httpsURL, id), http.StatusCreated)
http.Redirect(w, r, fmt.Sprintf("https://%s/paste/%s", s.httpsURL, id), http.StatusSeeOther)
}
}