Skip to content

Support of Azure Functions Node.js v4 programming modelΒ #637

@laghamn

Description

@laghamn

We've been using this package successfully for our Azure Functions using v3 programming model (with function.json files).
When we started our migration to v4 programming model we discovered that the parsing of multipart form data fails due to Exception: Missing Content-Type, even if headers from the request are identical as before.

Whats seems have changed is that @azure/functions package use a different definition of HttpRequest in version 4.

At the moment we are using the following workaround, but it would be preferable with support in @anzp/azure-function-multipart package:

const headers = {}
for (const [key, value] of request.headers.entries()) {
  headers[key] = value
}

const { files, fields } = await parseMultipartFormData(
  { ...request, body: Buffer.from(await request.arrayBuffer()) },
  { headers }
)

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