fix(providers): time out connection tests and guard undefined names
Apply a 15s AbortSignal timeout in fetchWithConnectionProxy when the caller supplies none, so provider connection tests stop hanging and exhausting the browser socket pool. Also make matchSearch return false for falsy provider names instead of crashing the providers page.
This commit is contained in:
1 parent
dff648496c
commit
df85e16d7a
2 files changed
+11
-3
No files matched your search
@@ -445,6 +445,12 @@ async function testOAuthConnection(connection, effectiveProxy = null) {
|
||||
}
|
||||
|
||||
async function fetchWithConnectionProxy(url, options = {}, effectiveProxy = null) {
|
||||
// Add a 15-second timeout to prevent connection testing from hanging indefinitely
|
||||
// and exhausting the browser/Node.js connection pools.
|
||||
if (!options.signal) {
|
||||
options.signal = AbortSignal.timeout(15000);
|
||||
}
|
||||
|
||||
// Vercel relay: forward via relay URL
|
||||
if (effectiveProxy?.vercelRelayUrl) {
|
||||
const { proxyAwareFetch } = await import("open-sse/utils/proxyFetch.js");
|
||||
|
||||
Reference in new issue
Block a user