Skip to content

Commit 8aa8b08

Browse files
Reverting Undici Changes (#361)
1 parent 4e09712 commit 8aa8b08

File tree

7 files changed

+26
-15
lines changed

7 files changed

+26
-15
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.2",
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.2';
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

src/trigger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
HttpTrigger,
1414
HttpTriggerOptions,
1515
MySqlTrigger,
16-
MySqlTriggerOptions,
16+
MySqlTriggerOptions,
1717
ServiceBusQueueTrigger,
1818
ServiceBusQueueTriggerOptions,
1919
ServiceBusTopicTrigger,

test/http/HttpRequest.test.ts

Lines changed: 3 additions & 2 deletions
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);
@@ -93,7 +94,7 @@ world
9394

9495
const parsedForm = await req.formData();
9596
expect(parsedForm.has('myfile')).to.equal(true);
96-
const file = <File>(<unknown>parsedForm.get('myfile'));
97+
const file = <File>parsedForm.get('myfile');
9798
expect(file.name).to.equal('test.txt');
9899
expect(file.type).to.equal('text/plain');
99100
expect(await file.text()).to.equal(`hello\r\nworld`);
@@ -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)