From 875ace5b2dafa3b86f9232eb2da99ba827ebbac7 Mon Sep 17 00:00:00 2001
From: Severian
Date: Sat, 4 Oct 2025 05:22:04 +0800
Subject: [PATCH] fix non-streaming
---
src/app/api/proxy/route.ts | 6 +-----
src/app/page.tsx | 11 ++++++++++-
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/app/api/proxy/route.ts b/src/app/api/proxy/route.ts
index 7293ea6..4916495 100644
--- a/src/app/api/proxy/route.ts
+++ b/src/app/api/proxy/route.ts
@@ -312,11 +312,7 @@ export async function POST(request: NextRequest) {
try {
const body = await request.json();
-
- // Check if this is a streaming request (JanitorAI expects SSE)
- const acceptHeader = request.headers.get("accept");
- const isStreamingRequest =
- acceptHeader?.includes("text/event-stream") || body.stream === true;
+ const isStreamingRequest = body.stream === true;
if (!body.messages || body.messages.length < 2) {
if (isStreamingRequest) {
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 15528e6..8a68833 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -81,6 +81,8 @@ export default function Home() {
Record
>({});
+ const [proxyUrl, setProxyUrl] = useState("https://sucker.severian.dev/api/proxy");
+
const fetchCards = async () => {
try {
setIsRefreshing(true);
@@ -107,6 +109,13 @@ export default function Home() {
fetchCards();
}, []);
+ useEffect(() => {
+ if (typeof window !== "undefined") {
+ const origin = window.location.origin;
+ setProxyUrl(`${origin}/api/proxy`);
+ }
+ }, []);
+
const downloadJson = (card: Card) => {
// Use initial version for download, or current version if no initial version available
const chosen = card.initialVersion || card.data;
@@ -382,7 +391,7 @@ export default function Home() {
-
- Put
https://sucker.severian.dev/api/proxy in your
+ Put {proxyUrl} in your
API settings, any value for model and key.
-