return full response for HEAD

This commit is contained in:
Don 2022-12-12 13:34:24 -07:00 committed by GitHub
parent 840e866e80
commit 7ed5ce61de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,8 +126,8 @@ EnhancedRequest.prototype._request = function (opts) {
// Sometimes CouchDB just returns an malformed error
if (!response || !response.body) {
if (response && opts.method === 'HEAD') {
// or we only want the response headers
return response.headers;
// or we only want the response/headers
return response;
}
err = new Error('malformed body');
err.error = 'malformed body';