From be7b0c4d3d8bae4974f4e3fd06d3f16137539d17 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Sat, 6 May 2023 00:47:07 +0900 Subject: [PATCH] Reduce logging in unshortenUrl --- http.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http.lua b/http.lua index a89f703..48990eb 100644 --- a/http.lua +++ b/http.lua @@ -65,6 +65,7 @@ http.unshortenUrl = function(url) local purl = url local nurl = url local count = 0 + local logger = hs.logger.new("unshorten", "info") while nurl ~= nil do local uri = hs.http.urlParts(nurl) @@ -76,8 +77,6 @@ http.unshortenUrl = function(url) local host = uri.host:lower() local isShortener = false for _, domain in ipairs(http.shortenerHosts) do - logger = hs.logger.new("unshorten", "info") - logger.i(host, domain, "." .. domain) if host == domain or utils.string.endsWith(host, "." .. domain) then isShortener = true break @@ -86,6 +85,7 @@ http.unshortenUrl = function(url) if not isShortener then return nurl, nil end + logger.i(host) if count >= 3 then return nurl, "too many redirects" end