From 2b2b12decd409ff627f199cdfaaa6cd3920ba2b9 Mon Sep 17 00:00:00 2001 From: Glen Maddern Date: Fri, 2 May 2025 11:19:22 +1000 Subject: [PATCH] Treat 404s and 405s as the same regardless of starting with SSE or HTTPs transport Fixes #47 #48 --- src/lib/utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 1b68bef..9e3e243 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -162,9 +162,10 @@ export async function connectToRemoteServer( if ( error instanceof Error && shouldAttemptFallback && - (sseTransport - ? error.message.includes('405') || error.message.includes('Method Not Allowed') - : error.message.includes('404') || error.message.includes('Not Found')) + (error.message.includes('405') || + error.message.includes('Method Not Allowed') || + error.message.includes('404') || + error.message.includes('Not Found')) ) { log(`Received error: ${error.message}`)