mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 17:44:57 +08:00
feat: add webdav support
This commit is contained in:
@@ -35,27 +35,29 @@ const nextConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
const CorsHeaders = [
|
||||
{ key: "Access-Control-Allow-Credentials", value: "true" },
|
||||
{ key: "Access-Control-Allow-Origin", value: "*" },
|
||||
{
|
||||
key: "Access-Control-Allow-Methods",
|
||||
value: "*",
|
||||
},
|
||||
{
|
||||
key: "Access-Control-Allow-Headers",
|
||||
value: "*",
|
||||
},
|
||||
{
|
||||
key: "Access-Control-Max-Age",
|
||||
value: "86400",
|
||||
},
|
||||
];
|
||||
|
||||
if (mode !== "export") {
|
||||
nextConfig.headers = async () => {
|
||||
return [
|
||||
{
|
||||
source: "/api/:path*",
|
||||
headers: [
|
||||
{ key: "Access-Control-Allow-Credentials", value: "true" },
|
||||
{ key: "Access-Control-Allow-Origin", value: "*" },
|
||||
{
|
||||
key: "Access-Control-Allow-Methods",
|
||||
value: "*",
|
||||
},
|
||||
{
|
||||
key: "Access-Control-Allow-Headers",
|
||||
value: "*",
|
||||
},
|
||||
{
|
||||
key: "Access-Control-Max-Age",
|
||||
value: "86400",
|
||||
},
|
||||
],
|
||||
headers: CorsHeaders,
|
||||
},
|
||||
];
|
||||
};
|
||||
@@ -76,15 +78,6 @@ if (mode !== "export") {
|
||||
},
|
||||
];
|
||||
|
||||
const apiUrl = process.env.API_URL;
|
||||
if (apiUrl) {
|
||||
console.log("[Next] using api url ", apiUrl);
|
||||
ret.push({
|
||||
source: "/api/:path*",
|
||||
destination: `${apiUrl}/:path*`,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
beforeFiles: ret,
|
||||
};
|
||||
|
Reference in New Issue
Block a user