Fix handling of empty responses.

This commit is contained in:
Tom Alexander 2022-05-12 10:33:06 -04:00
parent 155fb7ae00
commit 9a27ee8d5b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -124,11 +124,11 @@ impl GithubEndpointWatcher {
self.update_headers_from_response(&response, request_started_at)?;
let response_status = response.status();
let body = response.json::<serde_json::Value>().await?;
if let reqwest::StatusCode::NOT_MODIFIED = response_status {
return Ok(None);
} else {
let body = response.json::<serde_json::Value>().await?;
return Ok(Some(body));
}
}