diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-06-22 19:46:04 +0200 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-06-22 19:46:04 +0200 |
commit | dd7156e691928c702a27c00a565e118d2e23522e (patch) | |
tree | c0b98ea397852b1bfd212b315bb3e2e7a2f33ad5 /src/backend | |
parent | cc7d14514cada7a81d72612d612889b8c6f2e59e (diff) |
feat(backend): Tweak small nits in downloader
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/tubo/downloader_impl.clj | 6 |
1 files changed, 4 insertions, 2 deletions
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)) |