From fd9448f13222004e3c2f59f53a318b08e259db7b Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 3 Aug 2022 16:56:21 +0300 Subject: [PATCH] Habr also uses hsto.org domain --- rounds/habrImage.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rounds/habrImage.go b/rounds/habrImage.go index f8fb3d3..7129887 100644 --- a/rounds/habrImage.go +++ b/rounds/habrImage.go @@ -29,7 +29,8 @@ func RoundHabrImage( w http.ResponseWriter, req *http.Request, ) (bool, error) { - if host == "habrastorage.org" && strings.Contains(req.URL.Path, "r/w780q1/") { + if ((host == "habrastorage.org") || (host == "hsto.org")) && + strings.Contains(req.URL.Path, "r/w780q1/") { req.URL.Path = strings.Replace(req.URL.Path, "r/w780q1/", "", 1) http.Redirect(w, req, req.URL.String(), http.StatusFound) return false, nil -- 2.44.0