Added passing of site link to a template.
This commit is contained in:
parent
d554aa0a50
commit
eea0e0968a
@ -141,13 +141,15 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
|
||||
downloadURL := path.Join("/f", fSaltedHash, fHandler.Filename)
|
||||
downloadURLParsed, _ := url.Parse(downloadURL)
|
||||
|
||||
_, scheme := utils.NetworkType(r.Host)
|
||||
site := scheme + "://" + r.Host
|
||||
|
||||
if strings.Contains(r.UserAgent(), "curl") {
|
||||
_, scheme := utils.NetworkType(r.Host)
|
||||
w.Write([]byte(scheme + "://" + r.Host + downloadURLParsed.String() + "\r\n"))
|
||||
w.Write([]byte(site + downloadURLParsed.String() + "\r\n"))
|
||||
return
|
||||
}
|
||||
|
||||
web.Uploaded(utils.MainSite(r.Host), downloadURLParsed.String(), h.conf.Uploads.Limits.KeepForHours, w)
|
||||
web.Uploaded(utils.MainSite(r.Host), site, downloadURLParsed.String(), h.conf.Uploads.Limits.KeepForHours, w)
|
||||
}
|
||||
|
||||
func (h *UploadHandlers) Download(w http.ResponseWriter, r *http.Request) {
|
||||
|
Loading…
Reference in New Issue
Block a user