Monorepo for Wisp.place. A static site hosting service built on top of the AT Protocol.

update timeout on safe-fetch for hosting-service

Changed files
+3 -2
hosting-service
+1
hosting-service/src/lib/safe-fetch.ts
···
];
const FETCH_TIMEOUT = 5000; // 5 seconds
+
const FETCH_TIMEOUT_BLOB = 120000; // 2 minutes for blob downloads
const MAX_RESPONSE_SIZE = 10 * 1024 * 1024; // 10MB
function isBlockedHost(hostname: string): boolean {
+2 -2
hosting-service/src/lib/utils.ts
···
const blobUrl = `${pdsEndpoint}/xrpc/com.atproto.sync.getBlob?did=${encodeURIComponent(did)}&cid=${encodeURIComponent(cid)}`;
-
// Allow up to 100MB per file blob
-
let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024 });
+
// Allow up to 100MB per file blob, with 2 minute timeout
+
let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024, timeout: 120000 });
// If content is base64-encoded, decode it back to gzipped binary
if (base64 && encoding === 'gzip') {