apache / apache/couchdb

Improve CouchDB's understanding of multipart/related PUT requests

Open
#1,042 13 comments 0 reactions 0 assignees View on GitHub
feature
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.