Add compatible Bedrock integration names [skip ci]

This commit is contained in:
2026-11-19 19:30:05 +08:00
parent 960a3ff7ce
commit 0870ac7487
12 changed files with 37 additions and 30 deletions
+1
View File
@@ -0,0 +1 @@
export { GET, POST, PATCH, DELETE, PUT, HEAD, OPTIONS } from "../../foundry/[...path]/route";
+2 -2
View File
@@ -91,8 +91,8 @@ async function handler(
}
const bodyReceived = performance.now();
// 上游地址来自服务端环境,客户端path白名单不会让调用者自己指定任意目标源站。
const origin = process.env.FOUNDRY_API_ORIGIN || "https://api.foundry.entroia.com";
const project = process.env.NEXT_PUBLIC_FOUNDRY_PROJECT || "endoleap";
const origin = process.env.BEDROCK_API_ORIGIN || process.env.FOUNDRY_API_ORIGIN || "https://api.foundry.entroia.com";
const project = process.env.NEXT_PUBLIC_BEDROCK_PROJECT || process.env.NEXT_PUBLIC_FOUNDRY_PROJECT || "endoleap";
// multipart沿用浏览器Content-Type和boundary,其余发JSON;不透传浏览器任意请求头。
const headers: Record<string, string> = { "Content-Type": asset ? (req.headers.get("content-type") || "application/octet-stream") : "application/json" };
if (canvas) headers.Accept = "application/vnd.foundry.canvas+json;version=2";
+2 -2
View File
@@ -21,8 +21,8 @@ export async function GET(
)
return NextResponse.json({ error: "invalid_request" }, { status: 400 });
// 上游源站/项目由宿主环境装配,不让查询参数决定任意OAuth重定向目标。
const origin = process.env.FOUNDRY_API_ORIGIN || "https://api.foundry.entroia.com";
const project = process.env.NEXT_PUBLIC_FOUNDRY_PROJECT || "endoleap";
const origin = process.env.BEDROCK_API_ORIGIN || process.env.FOUNDRY_API_ORIGIN || "https://api.foundry.entroia.com";
const project = process.env.NEXT_PUBLIC_BEDROCK_PROJECT || process.env.NEXT_PUBLIC_FOUNDRY_PROJECT || "endoleap";
return NextResponse.redirect(
origin + "/projects/" + encodeURIComponent(project) + "/auth/" + provider + "?challenge=" + challenge,
{ status: 302, headers: { "Cache-Control": "no-store" } },