Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/app/api/settings/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import { applyOutboundProxyEnv } from "@/lib/network/outboundProxy";
import { resetComboRotation } from "open-sse/services/combo.js";
import bcrypt from "bcryptjs";

export const dynamic = "force-dynamic";
export const revalidate = 0;

const SETTINGS_RESPONSE_HEADERS = {
"Cache-Control": "no-store"
};

export async function GET() {
try {
const settings = await getSettings();
Expand All @@ -17,7 +24,7 @@ export async function GET() {
enableRequestLogs,
enableTranslator,
hasPassword: !!password
});
}, { headers: SETTINGS_RESPONSE_HEADERS });
} catch (error) {
console.log("Error getting settings:", error);
return NextResponse.json({ error: error.message }, { status: 500 });
Expand Down Expand Up @@ -77,7 +84,7 @@ export async function PATCH(request) {
}

const { password, ...safeSettings } = settings;
return NextResponse.json(safeSettings);
return NextResponse.json(safeSettings, { headers: SETTINGS_RESPONSE_HEADERS });
} catch (error) {
console.log("Error updating settings:", error);
return NextResponse.json({ error: error.message }, { status: 500 });
Expand Down