Redirect to /xd42/meta after upload #52
@ -198,6 +198,13 @@ func (rl *rushlink) viewCreateSuccess(w http.ResponseWriter, r *http.Request, p
|
||||
if fu != nil {
|
||||
fileExt = fu.Ext()
|
||||
}
|
||||
// Redirect to the new paste.
|
||||
pasteURL := url.URL{
|
||||
Path: fmt.Sprintf("/%s%s/meta", p.Key, fileExt),
|
||||
RawQuery: fmt.Sprintf("deleteToken=%s", url.QueryEscape(p.DeleteToken)),
|
||||
}
|
||||
http.Redirect(w, r, pasteURL.String(), http.StatusFound)
|
||||
// But still render the page for CURL-like clients.
|
||||
data := map[string]interface{}{
|
||||
"Paste": p,
|
||||
"FileExt": fileExt,
|
||||
|
Loading…
Reference in New Issue
Block a user