Treat 404s and 405s as the same regardless of starting with SSE or HTTPs transport

Fixes #47 #48
This commit is contained in:
Glen Maddern 2025-05-02 11:19:22 +10:00 committed by Glen Maddern
parent 5a38b58f63
commit 2b2b12decd

View file

@ -162,9 +162,10 @@ export async function connectToRemoteServer(
if ( if (
error instanceof Error && error instanceof Error &&
shouldAttemptFallback && shouldAttemptFallback &&
(sseTransport (error.message.includes('405') ||
? error.message.includes('405') || error.message.includes('Method Not Allowed') error.message.includes('Method Not Allowed') ||
: error.message.includes('404') || error.message.includes('Not Found')) error.message.includes('404') ||
error.message.includes('Not Found'))
) { ) {
log(`Received error: ${error.message}`) log(`Received error: ${error.message}`)