Improve CouchDB's understanding of multipart/related PUT requests
- Dominant language
- Erlang
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 9
Description
At present, to send a multipart/related PUT request to CouchDB, each attachment's length must be known beforehand, to create a JSON body such as:
```json
{
"_id":"doc_id",
"_attachments":{
"foo.txt": {
"content_type": "text/plain",
"following": true,
"length": 13
}
}
}
```
This defeats part of the benefit of using multipart/related to send attachments.
It would be nice if the `length` field could be omitted from the attachment stub, and instead inferred from the actual size of the respective part.
This would make it possible to write more efficient client code.
Contributor guide
Research direction
Start by tracing CouchDB's multipart/related PUT handling and how attachment stubs are parsed. Verify that an omitted length can be derived from each multipart part, then test requests with and without explicit lengths and confirm attachments are stored correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- api, databases, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100