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:
parent
4e3a9a3757
commit
a57f40cab1
|
@ -208,7 +208,7 @@ VALUES
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
fmt.Fprintf(w, "https://%s/paste/%s", s.httpsURL, id)
|
fmt.Fprintf(w, "https://%s/paste/%s", s.httpsURL, id)
|
||||||
default:
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue