Redirect traffic to the stylized paste page
This commit is contained in:
parent
b6f08fd243
commit
7f5d1cc7ca
3
main.go
3
main.go
|
@ -178,6 +178,9 @@ func saveHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
io.WriteString(w, "<p><b>URL</b>: <a href='"+b.URL+"'>"+b.URL+"</a></p>")
|
io.WriteString(w, "<p><b>URL</b>: <a href='"+b.URL+"'>"+b.URL+"</a></p>")
|
||||||
io.WriteString(w, "<p><b>Delete Key</b>: <a href='"+ADDRESS+"/del/"+b.ID+"/"+b.DELKEY+"'>"+b.DELKEY+"</a></p>")
|
io.WriteString(w, "<p><b>Delete Key</b>: <a href='"+ADDRESS+"/del/"+b.ID+"/"+b.DELKEY+"'>"+b.DELKEY+"</a></p>")
|
||||||
|
|
||||||
|
case "redirect":
|
||||||
|
http.Redirect(w, r, b.URL, 301)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
w.Header().Set("Content-Type", "plain/text")
|
w.Header().Set("Content-Type", "plain/text")
|
||||||
io.WriteString(w, b.URL+"\n")
|
io.WriteString(w, b.URL+"\n")
|
||||||
|
|
Loading…
Reference in New Issue