fix(clouddrop): route chunk PUTs via upload.clouddrop.cc (bypass CF)
Only the 16 MB chunk stream needs the upload subdomain; init and complete are tiny and can stay on the main host.
This commit is contained in:
parent
0bf3061852
commit
6780cf3261
@ -5,6 +5,7 @@ const { request, Agent } = require('undici');
|
|||||||
|
|
||||||
const BASE_URL = 'https://clouddrop.cc';
|
const BASE_URL = 'https://clouddrop.cc';
|
||||||
const API_BASE = `${BASE_URL}/api/cloud`;
|
const API_BASE = `${BASE_URL}/api/cloud`;
|
||||||
|
const CHUNK_UPLOAD_BASE = 'https://upload.clouddrop.cc/api/cloud';
|
||||||
const USER_AGENT = 'multi-hoster-uploader/1.0';
|
const USER_AGENT = 'multi-hoster-uploader/1.0';
|
||||||
|
|
||||||
const SIMPLE_UPLOAD_LIMIT = 16 * 1024 * 1024; // 16 MB
|
const SIMPLE_UPLOAD_LIMIT = 16 * 1024 * 1024; // 16 MB
|
||||||
@ -169,7 +170,7 @@ class ClouddropUploader {
|
|||||||
|
|
||||||
if (throttle) await throttle.consume(thisChunkSize, signal);
|
if (throttle) await throttle.consume(thisChunkSize, signal);
|
||||||
|
|
||||||
const chunkRes = await request(`${API_BASE}/upload/${sessionId}/chunk/${i}`, {
|
const chunkRes = await request(`${CHUNK_UPLOAD_BASE}/upload/${sessionId}/chunk/${i}`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
dispatcher: clouddropAgent,
|
dispatcher: clouddropAgent,
|
||||||
signal,
|
signal,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user