Skip to content

How can I use this with express-proxy? #112

Open
@sunshineo

Description

@sunshineo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions