Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
laghamn opened this issue Oct 17, 2023 · 2 comments
Open

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

laghamn opened this issue Oct 17, 2023 · 2 comments

Comments

@laghamn
Copy link

laghamn commented Oct 17, 2023

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 }
)
@LucasBonafe
Copy link

Did you find any alternative?

@laghamn
Copy link
Author

laghamn commented Aug 13, 2024

Did you find any alternative?

No, still using that workaround above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants