From 9a27ee8d5b6ff19fa78a647eccf687f322932467 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 12 May 2022 10:33:06 -0400 Subject: [PATCH] Fix handling of empty responses. --- src/githubctl/github_endpoint_watcher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/githubctl/github_endpoint_watcher.rs b/src/githubctl/github_endpoint_watcher.rs index fbed002..f3b6565 100644 --- a/src/githubctl/github_endpoint_watcher.rs +++ b/src/githubctl/github_endpoint_watcher.rs @@ -124,11 +124,11 @@ impl GithubEndpointWatcher { self.update_headers_from_response(&response, request_started_at)?; let response_status = response.status(); - let body = response.json::().await?; if let reqwest::StatusCode::NOT_MODIFIED = response_status { return Ok(None); } else { + let body = response.json::().await?; return Ok(Some(body)); } }