pillarjs / pillarjs/multiparty

How can I use this with express-proxy?

Open
#112 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.3k
Forks
164
Avg merge
4h 16m
Merged PRs (30d)
4

Description

Hello,

I'm using express-proxy to proxy a form post to s3.
I want to add a field to the form. (The signed signature).

But I do not have a full node request. What I have is the buffer containing the multipart.

app.use('/proxy/s3', proxy('https://' + config.s3Bucket + '.s3.amazonaws.com', {
    decorateRequest: function(req) {
        console.log(req.bodyContent.toString());
        return req;
    }
}));

The req.bodyContent is the buffer that contains the multipart.

Is it possible for me to use this library or I have to manipulate the buffer manually.

Thank you very much!

==Edit==
I just read https://github.com/andrewrk/node-multiparty/blob/master/examples/s3.js
Maybe I should completely change my pattern. However, I am still interested in the original question. Can you manipulate multipart data before proxy it?

==Edit 2==
Just read detail of https://github.com/andrewrk/node-multiparty/blob/master/examples/s3.js#L45
Maybe this is not possible through proxy since the content length will not be correct.

Contributor guide

No contributing guide indexed for this repository

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 comparing the express-proxy example using req.bodyContent with multiparty's examples/s3.js, especially the referenced line about content length. Determine whether multiparty exposes an entry point for modifying multipart data before proxying. Done means documenting a supported approach or clearly recording that this proxy pattern is not supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, nodejs
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.