You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/10/07 18:36:40 UTC
[GitHub] [couchdb] sploders101 opened a new issue #2244: Couchdb sends more
than requested range in attachments
sploders101 opened a new issue #2244: Couchdb sends more than requested range in attachments
URL: https://github.com/apache/couchdb/issues/2244
[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
## Description
When performing a request for a partial attachment, Couchdb starts at the correct file location, but sends more data than the Content-Length header suggests, causing an error in some http clients.
[NOTE]: # ( Describe the problem you're encountering. )
[TIP]: # ( Do NOT give us access or passwords to your actual CouchDB! )
## Steps to Reproduce
Upload a large text file as an attachment to a couchdb instance
Run:
```bash
nc 127.0.0.1 5984
```
and send this data, substituting your information.
```
GET /db/doc/attachment.ext HTTP/1.1
Range: bytes=1-4
Host: 127.0.0.1:5984
Connection: close
```
[NOTE]: # ( Include commands to reproduce, if possible. curl is preferred. )
## Expected Behaviour
CouchDB should send *only* the requested bytes.
[NOTE]: # ( Tell us what you expected to happen. )
## Your Environment
Fresh install
[TIP]: # ( Include as many relevant details about your environment as possible. )
[TIP]: # ( You can paste the output of curl http://YOUR-COUCHDB:5984/ here. )
* CouchDB Version used: 2.3.1
* Browser name and version: N/A
* Operating System and version: Linux (docker image couchdb:latest)
## Additional context
The specific type of attachment I'm using is an asar archive. I am attempting to read files from it without downloading the entire thing, and storing it to the fs/ram. It has a Content-Type of `application/octet-stream` in the database.
I am using node.js http.request function as my http client, but this is reproducible with any client that doesn't close the connection after `Content-Length` bytes.
[TIP]: # ( Add any other context about the prbolem here. )
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services