1
0

Added passing of site link to a template.

This commit is contained in:
Alexander Andreev 2022-08-01 01:09:11 +04:00
parent d554aa0a50
commit eea0e0968a
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -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)
if strings.Contains(r.UserAgent(), "curl") {
_, scheme := utils.NetworkType(r.Host)
w.Write([]byte(scheme + "://" + r.Host + downloadURLParsed.String() + "\r\n"))
site := scheme + "://" + r.Host
if strings.Contains(r.UserAgent(), "curl") {
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) {