Skip to content

[feature request]Have boundary and body as parameters instead of event #27

Description

@secretshardul

Issue I faced

Hi and really great work building a multipart parser for Lambda. Once issue I have with this library is that it only accepts 'event' as a parameter. While good for Lambda proxy integration, this is unsuitable for Lambda Custom integration.

Suggested feature

On looking at the code I see that your library just needs 2 parameters from the event object- 'Content-Type' header (for extracting boundary) and body(contains encoded string). Instead of asking for event, we could ask for these two parameters from the user. You can keep the existing function as it is, while adding a new function which incorporates these features.

For example

const multipart = require('aws-lambda-multipart-parser');
let body = event["body"];
let contentType = event["content-type"];
let output = multipart.parse(body, contentType, true);

If you don't mind, I can make a PR and you can add me as a collaborator for this library.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions