Skip to content

Commit 04658e1

Browse files
committed
Do not error if empty body on populateConsensusVersion (#18)
1 parent 043652b commit 04658e1

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

0 commit comments

Comments
 (0)