From dd7156e691928c702a27c00a565e118d2e23522e Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Thu, 22 Jun 2023 19:46:04 +0200 Subject: feat(backend): Tweak small nits in downloader --- src/backend/tubo/downloader_impl.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/backend') diff --git a/src/backend/tubo/downloader_impl.clj b/src/backend/tubo/downloader_impl.clj index 1582159..e22a2da 100644 --- a/src/backend/tubo/downloader_impl.clj +++ b/src/backend/tubo/downloader_impl.clj @@ -43,7 +43,7 @@ url (.url request) headers (.headers request) data-to-send (.dataToSend request) - request-body (when data-to-send (RequestBody/create nil data-to-send)) + request-body (and data-to-send (RequestBody/create nil data-to-send)) request-builder (.. (Request$Builder.) (method http-method request-body) (url url) @@ -60,7 +60,7 @@ (.header request-builder header-name (.get header-value-list 0)))))) (let [response (.. (@(.state this) :client) (newCall (.build request-builder)) (execute)) body (.body response) - response-body-to-return (when body (.string body)) + response-body-to-return (and body (.string body)) latest-url (.. response (request) (url) (toString))] (when (= (.code response) 429) (.close response)) @@ -69,3 +69,5 @@ (.. response (headers) (toMultimap)) response-body-to-return latest-url)))) + +(comment (compile 'tubo.downloader-impl)) -- cgit v1.2.3