@mastra/server-adapters-test-suite 0.1.1-alpha.0 → 0.1.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @mastra/server-adapters-test-suite
|
|
2
2
|
|
|
3
|
+
## 0.1.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added coverage for reserved field and parameter names in shared adapter request parsing tests ([#26683](https://github.com/mastra-ai/mastra/pull/26683))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`a65d0c7`](https://github.com/mastra-ai/mastra/commit/a65d0c788824081f36ccd95078a8d1214ff687c4), [`cb0201a`](https://github.com/mastra-ai/mastra/commit/cb0201ab41c36723b9f6e331464e5c74326865ed), [`e89310a`](https://github.com/mastra-ai/mastra/commit/e89310a8db29a663a85c6a31a8c376cc8f59c129), [`590d6ca`](https://github.com/mastra-ai/mastra/commit/590d6ca9fa6ccf8b55dcf2e98da080ee1a348f67)]:
|
|
10
|
+
- @mastra/core@1.76.0-alpha.9
|
|
11
|
+
- @mastra/server@1.76.0-alpha.9
|
|
12
|
+
|
|
13
|
+
## 0.1.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Allow `@mastra/mcp` 2.x in the peer dependency range. The two MCP transport tests that expect the legacy SSE routes to be removed now skip when running against `@mastra/mcp` 1.x, so out-of-tree adapters pass on either major version. ([#25062](https://github.com/mastra-ai/mastra/pull/25062))
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`8b8ba3a`](https://github.com/mastra-ai/mastra/commit/8b8ba3a4281a5307935567533f91c4227bc575df), [`9ce3444`](https://github.com/mastra-ai/mastra/commit/9ce3444d1a6b17e72b0a20c74603abaf252a843e), [`af4aed5`](https://github.com/mastra-ai/mastra/commit/af4aed50ad96b340d82a67c3f01cbf358b156ab2), [`43fbe75`](https://github.com/mastra-ai/mastra/commit/43fbe75535650345cf61dee00cf3e7b3f5efaf7f), [`e1c3193`](https://github.com/mastra-ai/mastra/commit/e1c3193b18ca68e5cca27f7dce9b0381a6e7b95d), [`4375206`](https://github.com/mastra-ai/mastra/commit/4375206131ff701405a20326be660b2e8c3742f8), [`5197f81`](https://github.com/mastra-ai/mastra/commit/5197f81d6a5641f80f0ee6596ac085653b38cca3), [`4601dfa`](https://github.com/mastra-ai/mastra/commit/4601dfac7c2bfdf04f041b1725c8ac4ae92a8d7d), [`77c6f1c`](https://github.com/mastra-ai/mastra/commit/77c6f1cf14ba9ba47257829646a4569c4462d12f), [`9773cb2`](https://github.com/mastra-ai/mastra/commit/9773cb2f22f307c8017f887af4a6728c4cb875c9), [`3d25340`](https://github.com/mastra-ai/mastra/commit/3d2534080417711d1baf2ad947d1205ca95a34cd), [`3b77788`](https://github.com/mastra-ai/mastra/commit/3b77788a08df1e754282d39c42823e6e1c5f2742), [`ebd03fd`](https://github.com/mastra-ai/mastra/commit/ebd03fd3bc93fe3930747956724252f7c8834826), [`63927e8`](https://github.com/mastra-ai/mastra/commit/63927e89c1b9db0fc87eef8503e3a03204f24b09), [`68cc668`](https://github.com/mastra-ai/mastra/commit/68cc66800e5ce6f5d62189fc7b5ef9d71cf80971), [`987257a`](https://github.com/mastra-ai/mastra/commit/987257a34cda8a153fe592c31d75fbb1dee55202), [`65a93a2`](https://github.com/mastra-ai/mastra/commit/65a93a2a3b1434d605a6a417cb83d2d58e16bfc0), [`fd92729`](https://github.com/mastra-ai/mastra/commit/fd92729380a29f2a0ec822e39f3c09eb9aaa5ac5), [`5e799d9`](https://github.com/mastra-ai/mastra/commit/5e799d9098c5c4d1078bf90647e95db699be11ea), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`457cb61`](https://github.com/mastra-ai/mastra/commit/457cb6164eb1203dce515f784378129d8dee30b2), [`afc53be`](https://github.com/mastra-ai/mastra/commit/afc53be4c95e83e8613f4e080b5a1926e63c5da6), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`2c57ba8`](https://github.com/mastra-ai/mastra/commit/2c57ba896b04215fface2a8216b88fe59cfdd041), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`93fe2d6`](https://github.com/mastra-ai/mastra/commit/93fe2d6a9e47861d90cc0fd0080aefdb8cabb612), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`781762b`](https://github.com/mastra-ai/mastra/commit/781762b2dcd0c8cc7f9b8ab73824ec45a5225db7), [`4d187b7`](https://github.com/mastra-ai/mastra/commit/4d187b79d7ecce4d2f357f5fe385b414a532ff19), [`cc0da13`](https://github.com/mastra-ai/mastra/commit/cc0da13b826d5f74213c4d8c470acf8698542249), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`2a28888`](https://github.com/mastra-ai/mastra/commit/2a28888f7dfee74f84ec548c9c222cfd1aa7f393), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`f6effda`](https://github.com/mastra-ai/mastra/commit/f6effdabafa9fc6388478b3e281ad4c457d4200b), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`ec005d5`](https://github.com/mastra-ai/mastra/commit/ec005d517ea10b7742e67f7e75bf89259d72c37e), [`f2c3f8c`](https://github.com/mastra-ai/mastra/commit/f2c3f8c74e1d7bc7baca5303b36320b0b361775c), [`cc0da13`](https://github.com/mastra-ai/mastra/commit/cc0da13b826d5f74213c4d8c470acf8698542249), [`ed67acc`](https://github.com/mastra-ai/mastra/commit/ed67acc3213d469ed69610c304c604693cfec383), [`0c23429`](https://github.com/mastra-ai/mastra/commit/0c23429515b5c307e8a5759f5be1ce20d09d2347), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`b33985e`](https://github.com/mastra-ai/mastra/commit/b33985eac3e019f58d3785c48ef85eae48b4e068), [`c64bf75`](https://github.com/mastra-ai/mastra/commit/c64bf752dec931f5f6c8b3d5afc91a8b9aa670d8), [`f2c3f8c`](https://github.com/mastra-ai/mastra/commit/f2c3f8c74e1d7bc7baca5303b36320b0b361775c), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`79c3b1f`](https://github.com/mastra-ai/mastra/commit/79c3b1fa4d470585a00558b317ed47db9b1decd4), [`4092ef2`](https://github.com/mastra-ai/mastra/commit/4092ef29aad09f2ba5f90c92a4d4d3bd444eae67), [`5f1efad`](https://github.com/mastra-ai/mastra/commit/5f1efad5c2230a4de715cad3f01859b4ff9d255b), [`32d71df`](https://github.com/mastra-ai/mastra/commit/32d71df2ce71573b40f9a62b8ac510ad6eadd859), [`7f4ce21`](https://github.com/mastra-ai/mastra/commit/7f4ce2190029710851d95f7b75a2fb724782483c), [`e62e372`](https://github.com/mastra-ai/mastra/commit/e62e3721356955f0a9fd3d723cee9fa0c160652b), [`4b5b212`](https://github.com/mastra-ai/mastra/commit/4b5b212f1c5caa40a2d02308806bbe610f194503), [`75c2ee1`](https://github.com/mastra-ai/mastra/commit/75c2ee1280a5441eb66c31f23a53a52b42244686), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`1fe1c2b`](https://github.com/mastra-ai/mastra/commit/1fe1c2b6f0b29481dca62a9199af751d594e3ea6), [`d3a7dba`](https://github.com/mastra-ai/mastra/commit/d3a7dbaeb0d027e1e47e4e4ddb2ede271a007e17), [`561e2a6`](https://github.com/mastra-ai/mastra/commit/561e2a6c8a44dbfd91eae390e14671462497cf85), [`64916c6`](https://github.com/mastra-ai/mastra/commit/64916c66e8d9dec107da2f81e7c1301471bf7bc3), [`80fa23c`](https://github.com/mastra-ai/mastra/commit/80fa23cd36c458ced4d4d0b6aad021296dd823bd), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`444debd`](https://github.com/mastra-ai/mastra/commit/444debd7104ada74fa15d0e70703ee9be180fc75), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`1ba1588`](https://github.com/mastra-ai/mastra/commit/1ba158873dadf3d290b111981c3bc7ef95ab1d1c), [`9a35897`](https://github.com/mastra-ai/mastra/commit/9a3589783a40157759f939f5c63bba3c8aef1c1c), [`9997948`](https://github.com/mastra-ai/mastra/commit/99979482956903a2cd685b31f53370dd33074799), [`279a736`](https://github.com/mastra-ai/mastra/commit/279a736c62495cac0f247ab1402a8c80bccc892a), [`d3a22a7`](https://github.com/mastra-ai/mastra/commit/d3a22a78f12e094118ce80ec35b63987009644e2), [`56fef1c`](https://github.com/mastra-ai/mastra/commit/56fef1cdd92a671c3de2cc5e4a319c637f700cf4), [`8156816`](https://github.com/mastra-ai/mastra/commit/815681621dd88997608c5b7e8f0f87fe03cd1d18), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`4d40bd9`](https://github.com/mastra-ai/mastra/commit/4d40bd91ccb00db163365a319b5d82bfb56a9ace), [`5e799d9`](https://github.com/mastra-ai/mastra/commit/5e799d9098c5c4d1078bf90647e95db699be11ea), [`94ba70e`](https://github.com/mastra-ai/mastra/commit/94ba70ea6ba8a53f5e4010392bf3bbaecde7966d), [`d2f0cd7`](https://github.com/mastra-ai/mastra/commit/d2f0cd7c5d5f5f06cf5b65cf78a9f14ac052dbb1), [`68cc668`](https://github.com/mastra-ai/mastra/commit/68cc66800e5ce6f5d62189fc7b5ef9d71cf80971), [`6946c4d`](https://github.com/mastra-ai/mastra/commit/6946c4db91071cb43fb36514a42a1e4ce05c37ba), [`e4e0f90`](https://github.com/mastra-ai/mastra/commit/e4e0f9000d73396609ae2f2b6c31259ade43078c), [`7540eb1`](https://github.com/mastra-ai/mastra/commit/7540eb176c32ffbff45ccc64a8d8fce82ce42a94), [`c01f1ad`](https://github.com/mastra-ai/mastra/commit/c01f1ad358db0ab361fdb1b2f4f77c88540c2671), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`b537ab1`](https://github.com/mastra-ai/mastra/commit/b537ab14714870e058775530bc55b37c9115613f), [`a7895fc`](https://github.com/mastra-ai/mastra/commit/a7895fce693e499c08c4784c57d4c4f46c0e1ccb), [`d8fcd39`](https://github.com/mastra-ai/mastra/commit/d8fcd397230a83f5fe9ef16e6b41237f057c2c29), [`5197f81`](https://github.com/mastra-ai/mastra/commit/5197f81d6a5641f80f0ee6596ac085653b38cca3), [`ffe2a4d`](https://github.com/mastra-ai/mastra/commit/ffe2a4db3847b26282cd31554c7a9487b8b8a5ed), [`caf94f9`](https://github.com/mastra-ai/mastra/commit/caf94f9c1927f737370b6118264bd16c7210a765), [`9623397`](https://github.com/mastra-ai/mastra/commit/96233975b75135852c9b1616b91fd8cb54c77a53), [`5036e61`](https://github.com/mastra-ai/mastra/commit/5036e6179bee4105ad8f1fc57d315f78024565f4), [`4375206`](https://github.com/mastra-ai/mastra/commit/4375206131ff701405a20326be660b2e8c3742f8), [`676fcbf`](https://github.com/mastra-ai/mastra/commit/676fcbfc5f770ee45560c7b558b17ad5ff25d9e7), [`6c9f7ab`](https://github.com/mastra-ai/mastra/commit/6c9f7abf9bdce0a52450398b31d497519465bb80), [`d9790fd`](https://github.com/mastra-ai/mastra/commit/d9790fd00d95063de288560f6a0d2bac8f57cc4d), [`4375206`](https://github.com/mastra-ai/mastra/commit/4375206131ff701405a20326be660b2e8c3742f8), [`91196d5`](https://github.com/mastra-ai/mastra/commit/91196d5a6d582c0f494622d0378f33e22d881659), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0c2fe6c`](https://github.com/mastra-ai/mastra/commit/0c2fe6c00909795234270c8ea2c2c53882d63798), [`5e799d9`](https://github.com/mastra-ai/mastra/commit/5e799d9098c5c4d1078bf90647e95db699be11ea), [`f36019c`](https://github.com/mastra-ai/mastra/commit/f36019c24193e0d29f920663851198bf45e3d12f), [`5026973`](https://github.com/mastra-ai/mastra/commit/50269736f432cee1170627b2b6f88ba1431e837f), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`4edc93d`](https://github.com/mastra-ai/mastra/commit/4edc93dedadb89686aad75a4853cb0aa807d256e), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`0be9960`](https://github.com/mastra-ai/mastra/commit/0be9960226ee1734e7ea0baecb5d13035f980b11), [`dd01709`](https://github.com/mastra-ai/mastra/commit/dd01709f780562f9ff8c72d977f3da5ae265970e), [`d4e350a`](https://github.com/mastra-ai/mastra/commit/d4e350a5c1e29a7da5a22da52ed1f33431403012)]:
|
|
20
|
+
- @mastra/server@1.72.0
|
|
21
|
+
- @mastra/core@1.72.0
|
|
22
|
+
- @mastra/mcp@2.1.1
|
|
23
|
+
|
|
3
24
|
## 0.1.1-alpha.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -926,12 +926,18 @@ async function createDefaultTestContext() {
|
|
|
926
926
|
...observability.getFeatures() ?? [],
|
|
927
927
|
"trace-query",
|
|
928
928
|
"trace-query-discovery",
|
|
929
|
-
"
|
|
929
|
+
"trace-aggregate",
|
|
930
|
+
"thread-query",
|
|
931
|
+
"span-query"
|
|
930
932
|
]);
|
|
931
933
|
vi.spyOn(observability, "queryTraces").mockResolvedValue({
|
|
932
934
|
traces: [],
|
|
933
935
|
page: { next: null }
|
|
934
936
|
});
|
|
937
|
+
vi.spyOn(observability, "aggregateTraces").mockResolvedValue({
|
|
938
|
+
rows: [],
|
|
939
|
+
truncated: false
|
|
940
|
+
});
|
|
935
941
|
vi.spyOn(observability, "getTraceQueryObservedFields").mockResolvedValue({
|
|
936
942
|
observedFields: [],
|
|
937
943
|
observedFieldsTruncated: false
|
|
@@ -944,6 +950,10 @@ async function createDefaultTestContext() {
|
|
|
944
950
|
threads: [],
|
|
945
951
|
page: { next: null }
|
|
946
952
|
});
|
|
953
|
+
vi.spyOn(observability, "querySpans").mockResolvedValue({
|
|
954
|
+
spans: [],
|
|
955
|
+
page: { next: null }
|
|
956
|
+
});
|
|
947
957
|
await observability.createSpan({ span: {
|
|
948
958
|
spanId: "test-span",
|
|
949
959
|
traceId: "test-trace",
|
|
@@ -1759,6 +1769,48 @@ function createRouteAdapterTestSuite(config) {
|
|
|
1759
1769
|
expect(response.status).toBe(200);
|
|
1760
1770
|
expect(response.data).toEqual({ userId: "query-user-123" });
|
|
1761
1771
|
});
|
|
1772
|
+
it("ignores special object keys in query params while preserving legitimate params", async () => {
|
|
1773
|
+
await setup.adapter.registerRoute(app, {
|
|
1774
|
+
method: "GET",
|
|
1775
|
+
path: "/test/query-special-keys",
|
|
1776
|
+
responseType: "json",
|
|
1777
|
+
handler: async (params) => ({
|
|
1778
|
+
filter: typeof params.filter === "string" ? JSON.parse(params.filter) : null,
|
|
1779
|
+
tag: params.tag ?? null,
|
|
1780
|
+
keys: Object.keys(params).filter((k) => ![
|
|
1781
|
+
"mastra",
|
|
1782
|
+
"requestContext",
|
|
1783
|
+
"tools",
|
|
1784
|
+
"taskStore",
|
|
1785
|
+
"abortSignal",
|
|
1786
|
+
"registeredTools",
|
|
1787
|
+
"routePrefix",
|
|
1788
|
+
"request"
|
|
1789
|
+
].includes(k))
|
|
1790
|
+
})
|
|
1791
|
+
});
|
|
1792
|
+
const response = await executeHttpRequest(app, {
|
|
1793
|
+
method: "GET",
|
|
1794
|
+
path: "/api/test/query-special-keys",
|
|
1795
|
+
query: Object.fromEntries([
|
|
1796
|
+
["__proto__[polluted]", "yes"],
|
|
1797
|
+
["constructor[prototype]", "yes"],
|
|
1798
|
+
["prototype[x]", "yes"],
|
|
1799
|
+
["filter[__proto__]", "yes"],
|
|
1800
|
+
["filter[status]", "active"],
|
|
1801
|
+
["tag", ["a", "b"]],
|
|
1802
|
+
["page", "2"]
|
|
1803
|
+
])
|
|
1804
|
+
});
|
|
1805
|
+
expect(response.status).toBe(200);
|
|
1806
|
+
const data = response.data;
|
|
1807
|
+
expect(data.filter).toEqual({ status: "active" });
|
|
1808
|
+
expect(Array.isArray(data.tag) ? data.tag : [data.tag]).toContain("b");
|
|
1809
|
+
expect(data.keys).not.toContain("__proto__");
|
|
1810
|
+
expect(data.keys).not.toContain("constructor");
|
|
1811
|
+
expect(data.keys).not.toContain("prototype");
|
|
1812
|
+
expect({}.polluted).toBeUndefined();
|
|
1813
|
+
});
|
|
1762
1814
|
describe.each([{
|
|
1763
1815
|
version: "v3",
|
|
1764
1816
|
recordSchema: z$1.record(z$1.string(), z$1.string()),
|
|
@@ -3483,6 +3535,59 @@ function createMultipartTestSuite(config) {
|
|
|
3483
3535
|
message: "Hello, World!"
|
|
3484
3536
|
});
|
|
3485
3537
|
});
|
|
3538
|
+
it("should ignore form fields named with special object keys", async () => {
|
|
3539
|
+
const { adapter, app } = await setupAdapter(context);
|
|
3540
|
+
const testRoute = {
|
|
3541
|
+
method: "POST",
|
|
3542
|
+
path: "/test/upload-special-keys",
|
|
3543
|
+
responseType: "json",
|
|
3544
|
+
handler: async (params) => {
|
|
3545
|
+
return {
|
|
3546
|
+
success: true,
|
|
3547
|
+
name: params.name ?? null,
|
|
3548
|
+
options: params.options ?? null,
|
|
3549
|
+
inheritedIsAdmin: params.isAdmin ?? null,
|
|
3550
|
+
bodyKeys: Object.keys(params).filter((k) => ![
|
|
3551
|
+
"mastra",
|
|
3552
|
+
"requestContext",
|
|
3553
|
+
"tools",
|
|
3554
|
+
"taskStore",
|
|
3555
|
+
"abortSignal",
|
|
3556
|
+
"registeredTools",
|
|
3557
|
+
"routePrefix",
|
|
3558
|
+
"request"
|
|
3559
|
+
].includes(k))
|
|
3560
|
+
};
|
|
3561
|
+
}
|
|
3562
|
+
};
|
|
3563
|
+
applyMiddleware(app, getContextMiddleware(adapter));
|
|
3564
|
+
await registerRoute(adapter, app, testRoute, { prefix: "" });
|
|
3565
|
+
serverInfo = await startServer(app);
|
|
3566
|
+
const formData = new FormData();
|
|
3567
|
+
formData.append("__proto__", JSON.stringify({ isAdmin: true }));
|
|
3568
|
+
formData.append("constructor", JSON.stringify({ prototype: { isAdmin: true } }));
|
|
3569
|
+
const fileBlob = new Blob([new Uint8Array([
|
|
3570
|
+
1,
|
|
3571
|
+
2,
|
|
3572
|
+
3
|
|
3573
|
+
])], { type: "application/octet-stream" });
|
|
3574
|
+
formData.append("prototype", fileBlob, "payload.bin");
|
|
3575
|
+
formData.append("name", "legit-recording");
|
|
3576
|
+
formData.append("options", JSON.stringify({ language: "en" }));
|
|
3577
|
+
const response = await fetch(`${serverInfo.baseUrl}/test/upload-special-keys`, {
|
|
3578
|
+
method: "POST",
|
|
3579
|
+
body: formData
|
|
3580
|
+
});
|
|
3581
|
+
expect(response.status).toBe(200);
|
|
3582
|
+
const result = await response.json();
|
|
3583
|
+
expect(result.name).toBe("legit-recording");
|
|
3584
|
+
expect(result.options).toMatchObject({ language: "en" });
|
|
3585
|
+
expect(result.inheritedIsAdmin).toBeNull();
|
|
3586
|
+
expect(result.bodyKeys).not.toContain("__proto__");
|
|
3587
|
+
expect(result.bodyKeys).not.toContain("constructor");
|
|
3588
|
+
expect(result.bodyKeys).not.toContain("prototype");
|
|
3589
|
+
expect({}.isAdmin).toBeUndefined();
|
|
3590
|
+
});
|
|
3486
3591
|
});
|
|
3487
3592
|
}
|
|
3488
3593
|
//#endregion
|