mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 02:20:10 +08:00
📝 docs: Add detailed comments explaining S3 proxy bypass fix
Co-authored-by: GeorgeDong32 <98630204+GeorgeDong32@users.noreply.github.com>
This commit is contained in:
parent
7a49042d7f
commit
97ab200657
@ -59,15 +59,18 @@ export default class S3Storage {
|
|||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
// Create a direct dispatcher for S3 to bypass proxy
|
// Fix for S3 backup failure when using proxy
|
||||||
// This prevents proxy interference with large file uploads that can cause incomplete transfers
|
// Issue: When proxy is enabled, S3 uploads can fail with incomplete writes
|
||||||
|
// Error: "Io error: put_object write size < data.size(), w_size=15728640, data.size=16396159"
|
||||||
|
// Root cause: AWS SDK uses global fetch/undici dispatcher which routes through proxy,
|
||||||
|
// causing data corruption or incomplete transfers for large files
|
||||||
|
// Solution: Configure S3Client with a direct dispatcher that bypasses the global proxy
|
||||||
const directDispatcher = new UndiciAgent({
|
const directDispatcher = new UndiciAgent({
|
||||||
connect: {
|
connect: {
|
||||||
timeout: 60000 // 60 second connection timeout
|
timeout: 60000 // 60 second connection timeout
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Use FetchHttpHandler with direct dispatcher to bypass global proxy settings
|
|
||||||
const requestHandler = new FetchHttpHandler({
|
const requestHandler = new FetchHttpHandler({
|
||||||
requestTimeout: 300000, // 5 minute request timeout for large files
|
requestTimeout: 300000, // 5 minute request timeout for large files
|
||||||
dispatcher: directDispatcher
|
dispatcher: directDispatcher
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user