ring-clojure / ring-clojure/ring

Automatic transfer-decoding of file content for multipart-params

Open
#260 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Clojure
Stars
3.9k
Forks
528
PR merge metrics
No merged PRs in 30d

Description

When receiving a file via multipart-params, there is an (optional) key
"Content-Transfer-Encoding" with values 7bit (default), 8bit, binary and base64.

Depending on these values, the file or byte array (depending on the store used) should automatically be decoded to its original form.

Using Java7 or higher, one can use (.decode (java.util.Base64/getDecoder) bytes) to receive a new byte array with the real payload.

This is an issue because upon receiving the data, the multpart-params middleware has the "Content-Transfer-Encoding" parameters available to select the correct decoding mechanism. But since the Content-Transfer-Encoding value is not transmitted further down the line, the actual consumer of the file has to guess the real Content-Transfer-Encoding.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the multipart-params middleware and trace how uploaded file or byte-array content is passed to consumers. Review how the Content-Transfer-Encoding values are currently exposed or discarded, then define completion as decoding 7bit, 8bit, binary, and base64 content before it reaches the consumer. The issue names no tests or specific files, so the relevant test entry points must be found in the middleware implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, java
Domain
backend
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.