Catch HEAD errors (#1460)
This commit is contained in:
committed by
GitHub
parent
dc2de57bd3
commit
d5f61c7833
@ -306,8 +306,8 @@ class Transport {
|
||||
return callback(err, result)
|
||||
}
|
||||
} else {
|
||||
// cast to boolean if the request method was HEAD
|
||||
result.body = isHead === true ? true : payload
|
||||
// cast to boolean if the request method was HEAD and there was no error
|
||||
result.body = isHead === true && result.statusCode < 400 ? true : payload
|
||||
}
|
||||
|
||||
// we should ignore the statusCode if the user has configured the `ignore` field with
|
||||
|
||||
Reference in New Issue
Block a user