From d04778883565e463632c78b624dee6b38318069f Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Mon, 11 Sep 2023 23:42:58 +0300 Subject: [PATCH] fix: download link was incorrect. Added hint for saving file --- main.go | 2 ++ templates/download-result.html | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 08678bc..32e86bb 100644 --- a/main.go +++ b/main.go @@ -88,6 +88,7 @@ type Context struct { StatusCode int Err *error IsTLS bool + DownloadURL string } func NewContext(r *http.Request) *Context { @@ -173,6 +174,7 @@ func main() { downloadURL := string(body) log.Println("URL from convx", downloadURL) + ctx.DownloadURL = downloadURL err = templates.ExecuteTemplate(w,"download-result.html", ctx) if err != nil { log.Println(err.Error()) diff --git a/templates/download-result.html b/templates/download-result.html index a6fa084..31e6e93 100644 --- a/templates/download-result.html +++ b/templates/download-result.html @@ -1,6 +1,9 @@
{{ if eq .StatusCode 200 }} -Download + + Download + +Right click and Click "Save link as" {{ else }}