diff --git a/package.json b/package.json index 26706e1..666d408 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "np": "^11.2.1", "prettier": "^3.2.4", "publint": "^0.3.18", - "supertest": "^6.3.3", + "supertest": "^7.2.2", "tsdown": "^0.20.3", "typescript": "^5.3.2", "vitest": "^4.0.18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f5d62c..4b214dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,8 +39,8 @@ importers: specifier: ^0.3.18 version: 0.3.18 supertest: - specifier: ^6.3.3 - version: 6.3.4 + specifier: ^7.2.2 + version: 7.2.2 tsdown: specifier: ^0.20.3 version: 0.20.3(publint@0.3.18)(typescript@5.9.3) @@ -1185,6 +1185,10 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie-signature@1.2.2: + resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} + engines: {node: '>=6.6.0'} + cookiejar@2.1.4: resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} @@ -1553,8 +1557,9 @@ packages: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} - formidable@2.1.5: - resolution: {integrity: sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==} + formidable@3.5.4: + resolution: {integrity: sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==} + engines: {node: '>=14.0.0'} fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -2615,15 +2620,13 @@ packages: resolution: {integrity: sha512-BWnYJElmHbYZ/zKevy+TG+SsyoFCmRPDHJbR1MzLxkPOv1Jp/4hGhVUtP98s+wZBsBsHwCXvPTP0x287/WMjGg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - superagent@8.1.2: - resolution: {integrity: sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==} - engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + superagent@10.3.0: + resolution: {integrity: sha512-B+4Ik7ROgVKrQsXTV0Jwp2u+PXYLSlqtDAhYnkkD+zn3yg8s/zjA2MeGayPoY/KICrbitwneDHrjSotxKL+0XQ==} + engines: {node: '>=14.18.0'} - supertest@6.3.4: - resolution: {integrity: sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==} - engines: {node: '>=6.4.0'} - deprecated: Please upgrade to supertest v7.1.3+, see release notes at https://github.com/forwardemail/supertest/releases/tag/v7.1.3 - maintenance is supported by Forward Email @ https://forwardemail.net + supertest@7.2.2: + resolution: {integrity: sha512-oK8WG9diS3DlhdUkcFn4tkNIiIbBx9lI2ClF8K+b2/m8Eyv47LSawxUzZQSNKUrVb2KsqeTDCcjAAVPYaSLVTA==} + engines: {node: '>=14.18.0'} supports-color@10.2.2: resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==} @@ -3920,6 +3923,8 @@ snapshots: convert-source-map@2.0.0: {} + cookie-signature@1.2.2: {} + cookiejar@2.1.4: {} cosmiconfig@9.0.2(typescript@5.9.3): @@ -4311,12 +4316,11 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 - formidable@2.1.5: + formidable@3.5.4: dependencies: '@paralleldrive/cuid2': 2.3.1 dezalgo: 1.0.4 once: 1.4.0 - qs: 6.15.0 fsevents@2.3.3: optional: true @@ -5348,25 +5352,25 @@ snapshots: escape-string-regexp: 5.0.0 unique-string: 3.0.0 - superagent@8.1.2: + superagent@10.3.0: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 debug: 4.4.3 fast-safe-stringify: 2.1.1 form-data: 4.0.5 - formidable: 2.1.5 + formidable: 3.5.4 methods: 1.1.2 mime: 2.6.0 qs: 6.15.0 - semver: 7.7.4 transitivePeerDependencies: - supports-color - supertest@6.3.4: + supertest@7.2.2: dependencies: + cookie-signature: 1.2.2 methods: 1.1.2 - superagent: 8.1.2 + superagent: 10.3.0 transitivePeerDependencies: - supports-color diff --git a/test/assets/static-with-precompressed/hello.bin.br b/test/assets/static-with-precompressed/hello.bin.br index 2584ce1..dba7812 100644 --- a/test/assets/static-with-precompressed/hello.bin.br +++ b/test/assets/static-with-precompressed/hello.bin.br @@ -1 +1 @@ -Hello br Compressed \ No newline at end of file + €Hello br Compressed \ No newline at end of file diff --git a/test/assets/static-with-precompressed/hello.txt.br b/test/assets/static-with-precompressed/hello.txt.br index 2584ce1..dba7812 100644 --- a/test/assets/static-with-precompressed/hello.txt.br +++ b/test/assets/static-with-precompressed/hello.txt.br @@ -1 +1 @@ -Hello br Compressed \ No newline at end of file + €Hello br Compressed \ No newline at end of file diff --git a/test/serve-static.test.ts b/test/serve-static.test.ts index 39fad9a..b0e4bb7 100644 --- a/test/serve-static.test.ts +++ b/test/serve-static.test.ts @@ -261,7 +261,7 @@ describe('Serve Static Middleware', () => { .get('/static-with-precompressed/hello.txt') .set('Accept-Encoding', 'wompwomp, gzip, br, deflate, zstd') expect(res.status).toBe(200) - expect(res.headers['content-length']).toBe('19') + expect(res.headers['content-length']).toBe('23') expect(res.headers['content-encoding']).toBe('br') expect(res.headers['vary']).toBe('Accept-Encoding') expect(res.text).toBe('Hello br Compressed') @@ -283,7 +283,7 @@ describe('Serve Static Middleware', () => { .set('Accept-Encoding', 'gzip, br, zstd') expect(res.status).toBe(200) expect(res.headers['content-type']).toBe('application/octet-stream') - expect(res.headers['content-length']).toBe('19') + expect(res.headers['content-length']).toBe('23') expect(res.headers['content-encoding']).toBe('br') expect(res.headers['vary']).toBe('Accept-Encoding') expect(res.body.toString()).toBe('Hello br Compressed')