diff --git a/src/module/proxy/ai-proxy.ts b/src/module/proxy/ai-proxy.ts index 3d8c00a..feab520 100644 --- a/src/module/proxy/ai-proxy.ts +++ b/src/module/proxy/ai-proxy.ts @@ -16,6 +16,7 @@ const getAiProxy = async (req: IncomingMessage, res: ServerResponse, opts: Proxy const pathname = _u.pathname; const params = _u.searchParams; const password = params.get('p'); + const hash = params.get('hash'); let objectName = ''; let owner = ''; const { user, app } = getUserFromRequest(req); @@ -42,6 +43,11 @@ const getAiProxy = async (req: IncomingMessage, res: ServerResponse, opts: Proxy if (!checkPermission.success) { return createNotFoundPage('no permission'); } + if (hash && stat.etag === hash) { + res.writeHead(304); // not modified + res.end('not modified') + return true; + } const filterMetaData = filterKeys(stat.metaData, ['size', 'etag', 'last-modified']); const contentLength = stat.size; const etag = stat.etag;