Skip to content

Commit 53ea2ac

Browse files
committed
chore: revert media proxy signature
not now
1 parent c1cde0e commit 53ea2ac

File tree

3 files changed

+0
-59
lines changed

3 files changed

+0
-59
lines changed

src/download.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type DownloadConfig = {
1919
httpAgent: http.Agent,
2020
httpsAgent: https.Agent,
2121
proxy?: boolean;
22-
signatureKey?: string;
2322
}
2423

2524
export const defaultDownloadConfig = {

src/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { StatusError } from './status-error.js';
1515
import { DownloadConfig, defaultDownloadConfig, downloadUrl } from './download.js';
1616
import { getAgents } from './http.js';
1717
import _contentDisposition from 'content-disposition';
18-
import { verifySignedProxyURL } from "./sign-proxy-url.js";
1918

2019
const _filename = fileURLToPath(import.meta.url);
2120
const _dirname = dirname(_filename);
@@ -29,7 +28,6 @@ export type MediaProxyOptions = {
2928
userAgent?: string;
3029
allowedPrivateNetworks?: string[];
3130
maxSize?: number;
32-
signatureKey?: string;
3331
} & ({
3432
proxy?: string;
3533
} | {
@@ -56,7 +54,6 @@ export function setMediaProxyConfig(setting?: MediaProxyOptions | null) {
5654
userAgent: setting.userAgent ?? defaultDownloadConfig.userAgent,
5755
allowedPrivateNetworks: setting.allowedPrivateNetworks ?? defaultDownloadConfig.allowedPrivateNetworks,
5856
maxSize: setting.maxSize ?? defaultDownloadConfig.maxSize,
59-
signatureKey: setting.signatureKey ?? undefined,
6057
...('proxy' in setting ?
6158
{ ...getAgents(setting.proxy), proxy: !!setting.proxy } :
6259
'httpAgent' in setting ? {
@@ -127,12 +124,6 @@ async function proxyHandler(request: FastifyRequest<{ Params: { url: string; };
127124
return;
128125
}
129126

130-
// 检查签名是否符合
131-
if (!!config.signatureKey && !verifySignedProxyURL(request.url, config.signatureKey)) {
132-
reply.code(401);
133-
return;
134-
}
135-
136127
// Create temp file
137128
const file = await downloadAndDetectTypeFromUrl(url);
138129

src/sign-proxy-url.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)