creativityjuice opened a new issue, #301:
URL: https://github.com/apache/couchdb-nano/issues/301
<!--- Provide a general summary of the issue in the Title above -->
Trying to use db.head to get document size fast, it returns headers without
content-length. I switched to axios just for that call to access document size.
Here is a simple piece of code :
```
const db = nano.db.use('accounts');
const nano_account_headers = await
db.head('00000000-0000-0000-0000-ffffffffffff');
console.log('nano_account_headers -', nano_account_headers);
const axios_account = await
axios.head(`${db_url}/accounts/00000000-0000-0000-0000-ffffffffffff`);
console.log('axios_account.headers -', axios_account.headers);
```
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work
-->
Here is what I get with axios, and therefor have with nano:
```
axios_account.headers - {
server: 'nginx',
date: 'Mon, 20 Jun 2022 13:24:14 GMT',
'content-type': 'application/json',
**'content-length': '1156',**
connection: 'close',
'cache-control': 'must-revalidate',
etag: '"xx-xxxxxxxxxxxxxxxxxxxxxxxxx"',
'x-couch-request-id': 'xxxxxxxxxx',
'x-couchdb-body-time': '0',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload'
}
```
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected
behavior -->
<!--- If suggesting a change/improvement, explain the difference from
current behavior -->
Here is what I get with nano:
```
nano_account_headers - {
uri: 'https://xxxxxxxx.com/accounts/00000000-0000-0000-0000-ffffffffffff',
statusCode: 200,
date: 'Mon, 20 Jun 2022 13:24:14 GMT',
'content-type': 'application/json',
connection: 'close',
'cache-control': 'must-revalidate',
etag: '"xx-xxxxxxxxxxxxxxxxxxxx"',
'x-couch-request-id': 'xxxxxxxxxx',
'x-couchdb-body-time': '0',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload'
}
```
## Your Environment
<!--- Include as many relevant details about the environment you experienced
the bug in -->
* Version used: 7.1.1
* Browser Name and version: Node 16.5.1
* Operating System and version (desktop or mobile): Ubuntu 20.04
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]