fix(images): allow capability preview reads through the access proxy
This commit is contained in:
parent
3a2ee064d0
commit
a643b3e9cf
9
proxy.ts
9
proxy.ts
@ -798,6 +798,15 @@ export async function proxy(request: NextRequest, event: NextFetchEvent) {
|
|||||||
return NextResponse.next();
|
return NextResponse.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generated inline previews use an unguessable image key, like signed provider URLs.
|
||||||
|
// Reference-image services need to read the image before background storage finishes.
|
||||||
|
if (
|
||||||
|
(request.method === "GET" || request.method === "HEAD") &&
|
||||||
|
/^\/api\/generated-image-preview\/[a-f0-9]{64}$/.test(pathname)
|
||||||
|
) {
|
||||||
|
return NextResponse.next();
|
||||||
|
}
|
||||||
|
|
||||||
// 允许匿名访问新版首页灵感数据
|
// 允许匿名访问新版首页灵感数据
|
||||||
if (pathname === "/api/featured" || pathname.startsWith("/api/featured/")) {
|
if (pathname === "/api/featured" || pathname.startsWith("/api/featured/")) {
|
||||||
return NextResponse.next();
|
return NextResponse.next();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user