mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-01-23 02:14:33 +00:00
Remote upload: Add direct_url param for redirect
This commit is contained in:
parent
a0c508c422
commit
7543c82473
1 changed files with 6 additions and 1 deletions
|
|
@ -184,6 +184,7 @@ func uploadRemote(c web.C, w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
upReq := UploadRequest{}
|
||||
grabUrl, _ := url.Parse(r.FormValue("url"))
|
||||
directURL := r.FormValue("direct_url") == "yes"
|
||||
|
||||
resp, err := http.Get(grabUrl.String())
|
||||
if err != nil {
|
||||
|
|
@ -215,7 +216,11 @@ func uploadRemote(c web.C, w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, Config.sitePath+upload.Filename, 303)
|
||||
if directURL {
|
||||
http.Redirect(w, r, Config.sitePath+Config.selifPath+upload.Filename, 303)
|
||||
} else {
|
||||
http.Redirect(w, r, Config.sitePath+upload.Filename, 303)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue