From 617156b18df7f2b8bf0467aa9a5e62a43f284abb Mon Sep 17 00:00:00 2001 From: Meisam <39205857+MFTabriz@users.noreply.github.com> Date: Sun, 18 Jul 2021 05:28:20 +0200 Subject: [PATCH] link assets under the same protocol for bots (#1187) * link assets under the same protocol * use // for metadata urls --- controllers/index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/index.go b/controllers/index.go index ec377899c..e64ff79c5 100644 --- a/controllers/index.go +++ b/controllers/index.go @@ -75,11 +75,11 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) { func handleScraperMetadataPage(w http.ResponseWriter, r *http.Request) { tmpl := template.Must(template.ParseFiles(path.Join("static", "metadata.html"))) - fullURL, err := url.Parse(fmt.Sprintf("http://%s%s", r.Host, r.URL.Path)) + fullURL, err := url.Parse(fmt.Sprintf("//%s%s", r.Host, r.URL.Path)) if err != nil { log.Panicln(err) } - imageURL, err := url.Parse(fmt.Sprintf("http://%s%s", r.Host, "/logo")) + imageURL, err := url.Parse(fmt.Sprintf("//%s%s", r.Host, "/logo")) if err != nil { log.Panicln(err) } @@ -89,7 +89,7 @@ func handleScraperMetadataPage(w http.ResponseWriter, r *http.Request) { // If the thumbnail does not exist or we're offline then just use the logo image var thumbnailURL string if status.Online && utils.DoesFileExists(filepath.Join(config.WebRoot, "thumbnail.jpg")) { - thumbnail, err := url.Parse(fmt.Sprintf("http://%s%s", r.Host, "/thumbnail.jpg")) + thumbnail, err := url.Parse(fmt.Sprintf("//%s%s", r.Host, "/thumbnail.jpg")) if err != nil { log.Errorln(err) thumbnailURL = imageURL.String()