From a57f40cab1686f74679fb5fa4520a0b7c37cdbb2 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Thu, 23 Feb 2023 16:54:14 +0000 Subject: [PATCH] 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 --- cmd/web/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/web/main.go b/cmd/web/main.go index 63ee085..274d019 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -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) } }