feat: 支持自定义订阅节点并兼容现有数据库
This commit is contained in:
@@ -18,11 +18,20 @@ export async function GET(
|
||||
return new NextResponse("node not found", { status: 404 });
|
||||
}
|
||||
|
||||
return new NextResponse(buildNodeHy2Config(node, getOriginFromRequest(request)), {
|
||||
status: 200,
|
||||
headers: {
|
||||
"Content-Type": "application/x-yaml; charset=utf-8",
|
||||
"Content-Disposition": `attachment; filename="${slug}.config.yaml"`,
|
||||
if (node.node_type !== "hy2") {
|
||||
return new NextResponse("hy2 config unavailable for custom node", {
|
||||
status: 409,
|
||||
});
|
||||
}
|
||||
|
||||
return new NextResponse(
|
||||
buildNodeHy2Config(node, getOriginFromRequest(request)),
|
||||
{
|
||||
status: 200,
|
||||
headers: {
|
||||
"Content-Type": "application/x-yaml; charset=utf-8",
|
||||
"Content-Disposition": `attachment; filename="${slug}.config.yaml"`,
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user