Skip to content

Updating the undici Major Version #350

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

Merged
merged 3 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/functions",
"version": "4.7.2",
"version": "4.7.3",
"description": "Microsoft Azure Functions NodeJS Framework",
"keywords": [
"azure",
Expand Down Expand Up @@ -43,7 +43,7 @@
"dependencies": {
"cookie": "^0.7.0",
"long": "^4.0.0",
"undici": "^5.29.0"
"undici": "^7.10.0"
},
"devDependencies": {
"@types/chai": "^4.2.22",
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

export const version = '4.7.2';
export const version = '4.7.3';

export const returnBindingKey = '$return';
1 change: 1 addition & 0 deletions src/http/HttpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class HttpRequest implements types.HttpRequest {
}

async formData(): Promise<FormData> {
// eslint-disable-next-line deprecation/deprecation
return this.#uReq.formData();
}

Expand Down
1 change: 1 addition & 0 deletions src/http/HttpResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class HttpResponse implements types.HttpResponse {
}

async formData(): Promise<FormData> {
// eslint-disable-next-line deprecation/deprecation
return this.#uRes.formData();
}

Expand Down
2 changes: 1 addition & 1 deletion src/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
HttpTrigger,
HttpTriggerOptions,
MySqlTrigger,
MySqlTriggerOptions,
MySqlTriggerOptions,
ServiceBusQueueTrigger,
ServiceBusQueueTriggerOptions,
ServiceBusTopicTrigger,
Expand Down
5 changes: 2 additions & 3 deletions test/http/HttpRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'mocha';
import * as chai from 'chai';
import { expect } from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import { File } from 'undici';
import { HttpRequest } from '../../src/http/HttpRequest';

chai.use(chaiAsPromised);
Expand Down Expand Up @@ -94,7 +93,7 @@ world

const parsedForm = await req.formData();
expect(parsedForm.has('myfile')).to.equal(true);
const file = <File>parsedForm.get('myfile');
const file = <File>(<unknown>parsedForm.get('myfile'));
expect(file.name).to.equal('test.txt');
expect(file.type).to.equal('text/plain');
expect(await file.text()).to.equal(`hello\r\nworld`);
Expand Down Expand Up @@ -135,7 +134,7 @@ value2
const contentTypes = ['application/octet-stream', 'application/json', 'text/plain', 'invalid'];
for (const contentType of contentTypes) {
const req = createFormRequest('', contentType);
await expect(req.formData()).to.eventually.be.rejectedWith(/Could not parse content as FormData/i);
await expect(req.formData()).to.eventually.be.rejectedWith(/Content-Type was not one of /i);
}
});
});
Expand Down
Loading