tangled
alpha
login
or
join now
ptr.pet
/
wisp.place-monorepo
forked from
nekomimi.pet/wisp.place-monorepo
0
fork
atom
Monorepo for Wisp.place. A static site hosting service built on top of the AT Protocol.
0
fork
atom
overview
issues
pulls
pipelines
update timeout on safe-fetch for hosting-service
@nekomimi.pet
4 months ago
b968cedf
f9d894c3
+3
-2
2 changed files
expand all
collapse all
unified
split
hosting-service
src
lib
safe-fetch.ts
utils.ts
+1
hosting-service/src/lib/safe-fetch.ts
···
22
22
];
23
23
24
24
const FETCH_TIMEOUT = 5000; // 5 seconds
25
25
+
const FETCH_TIMEOUT_BLOB = 120000; // 2 minutes for blob downloads
25
26
const MAX_RESPONSE_SIZE = 10 * 1024 * 1024; // 10MB
26
27
27
28
function isBlockedHost(hostname: string): boolean {
+2
-2
hosting-service/src/lib/utils.ts
···
265
265
266
266
const blobUrl = `${pdsEndpoint}/xrpc/com.atproto.sync.getBlob?did=${encodeURIComponent(did)}&cid=${encodeURIComponent(cid)}`;
267
267
268
268
-
// Allow up to 100MB per file blob
269
269
-
let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024 });
268
268
+
// Allow up to 100MB per file blob, with 2 minute timeout
269
269
+
let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024, timeout: 120000 });
270
270
271
271
// If content is base64-encoded, decode it back to gzipped binary
272
272
if (base64 && encoding === 'gzip') {