fix: force HTTPS S3 endpoint to avoid Coolify 307 on uploads
http://s3 hosts redirect to https; AWS SDK cannot follow PUT redirects, which caused XML parse errors.
This commit is contained in:
@@ -80,6 +80,12 @@ const logS3Error = (label, error) => {
|
||||
+ (status ? ` (HTTP ${status})` : '')
|
||||
+ (bodyPreview ? ` body=${bodyPreview.replace(/\s+/g, ' ')}` : '')
|
||||
);
|
||||
if (status === 307 || /Temporary Redirect/i.test(String(error.message) + bodyPreview)) {
|
||||
logger.error(
|
||||
'[S3 Storage ERROR] Hint: HTTP 307 means S3_ENDPOINT is redirecting (often http→https). '
|
||||
+ `Set S3_ENDPOINT=https://… (current: ${config.S3_ENDPOINT}). AWS SDK does not follow PUT redirects.`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const uploadToTempBucket = async (fileBuffer, filename, contentType = 'application/octet-stream') => {
|
||||
|
||||
Reference in New Issue
Block a user