Related issue: #68
This commit is contained in:
Daan Sprenkels 2020-07-27 16:57:55 +02:00
parent 26be9b5104
commit 50baaeadf1

View File

@ -142,9 +142,11 @@ func (rl *rushlink) viewPasteHandlerInner(w http.ResponseWriter, r *http.Request
rl.viewFileUploadHandler(w, r, fu)
return
case db.PasteTypeRedirect:
if flags&viewNoRedirect == 0 {
http.Redirect(w, r, p.RedirectURL().String(), http.StatusTemporaryRedirect)
if flags&viewNoRedirect != 0 {
w.Write([]byte(p.RedirectURL().String()))
return
}
http.Redirect(w, r, p.RedirectURL().String(), http.StatusTemporaryRedirect)
return
default:
panic("paste type unsupported")