Skip to content

Commit ecccb06

Browse files
committed
Revert "Updating the undici Major Version (Azure#350)"
This reverts commit c543818. The support range for undici in newer versions does not match the current @azure/functions support range. The original commit broke Node.js 18 support, due to unidici 7 only supporting Node.js 20 and above. Latest undici supports >=18.17, while the latest undici release that had full Node.js 18 support is v6.13.0. Since v6.13.0 has known security issues, it's just a plain revert.
1 parent c543818 commit ecccb06

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

package-lock.json

Lines changed: 19 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/functions",
3-
"version": "4.7.3",
3+
"version": "4.7.4",
44
"description": "Microsoft Azure Functions NodeJS Framework",
55
"keywords": [
66
"azure",
@@ -43,7 +43,7 @@
4343
"dependencies": {
4444
"cookie": "^0.7.0",
4545
"long": "^4.0.0",
46-
"undici": "^7.10.0"
46+
"undici": "^5.29.0"
4747
},
4848
"devDependencies": {
4949
"@types/chai": "^4.2.22",

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
export const version = '4.7.3';
4+
export const version = '4.7.4';
55

66
export const returnBindingKey = '$return';

src/http/HttpRequest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ export class HttpRequest implements types.HttpRequest {
9696
}
9797

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

src/http/HttpResponse.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export class HttpResponse implements types.HttpResponse {
6363
}
6464

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

test/http/HttpRequest.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'mocha';
55
import * as chai from 'chai';
66
import { expect } from 'chai';
77
import * as chaiAsPromised from 'chai-as-promised';
8+
import { File } from 'undici';
89
import { HttpRequest } from '../../src/http/HttpRequest';
910

1011
chai.use(chaiAsPromised);
@@ -134,7 +135,7 @@ value2
134135
const contentTypes = ['application/octet-stream', 'application/json', 'text/plain', 'invalid'];
135136
for (const contentType of contentTypes) {
136137
const req = createFormRequest('', contentType);
137-
await expect(req.formData()).to.eventually.be.rejectedWith(/Content-Type was not one of /i);
138+
await expect(req.formData()).to.eventually.be.rejectedWith(/Could not parse content as FormData/i);
138139
}
139140
});
140141
});

0 commit comments

Comments
 (0)