Fix handling of empty responses.
This commit is contained in:
parent
155fb7ae00
commit
9a27ee8d5b
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user