diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index fedc346..16ad321 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -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) {