Skip to content

Commit 7511547

Browse files
authored
Do not error if empty body on populateConsensusVersion (#17)
1 parent 2507e73 commit 7511547

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
@@ -370,8 +370,8 @@ func populateConsensusVersion(res *httpResponse, resp *http.Response) error {
370370
respConsensusVersions, exists := resp.Header["Eth-Consensus-Version"]
371371
if !exists {
372372
// No consensus version supplied in response; obtain it from the body if possible.
373-
if res.contentType != ContentTypeJSON {
374-
// Not present here either. Many responses do not provide this information, so assume
373+
if res.contentType != ContentTypeJSON || res.body == nil || len(res.body) == 0 {
374+
// Not present here either. Many responses do not provide this information, so assume
375375
// this is one of them.
376376
return nil
377377
}

0 commit comments

Comments
 (0)