Skip to content

Commit 47e619e

Browse files
authored
Do not error if empty body on populateConsensusVersion (#18)
1 parent ea96b35 commit 47e619e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

http/http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ func populateConsensusVersion(res *httpResponse, resp *http.Response) error {
375375
respConsensusVersions, exists := resp.Header["Eth-Consensus-Version"]
376376
if !exists {
377377
// No consensus version supplied in response; obtain it from the body if possible.
378-
if res.contentType != ContentTypeJSON {
379-
// Not present here either. Many responses do not provide this information, so assume
378+
if res.contentType != ContentTypeJSON || res.body == nil || len(res.body) == 0 {
379+
// Not present here either. Many responses do not provide this information, so assume
380380
// this is one of them.
381381
return nil
382382
}

0 commit comments

Comments
 (0)