mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[bug] Fix ERR_INVALID_PROTOCOL error; Fix bug 73913
This commit is contained in:
@ -33,7 +33,8 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const url = require('url');
|
||||
const { Agent } = require('https');
|
||||
const { Agent: HttpsAgent } = require('https');
|
||||
const { Agent: HttpAgent } = require('http');
|
||||
const path = require('path');
|
||||
const { S3Client, ListObjectsCommand, HeadObjectCommand} = require("@aws-sdk/client-s3");
|
||||
const { GetObjectCommand, PutObjectCommand, CopyObjectCommand} = require("@aws-sdk/client-s3");
|
||||
@ -76,11 +77,12 @@ function getS3Client(storageCfg) {
|
||||
configS3.tls = storageCfg.sslEnabled;
|
||||
configS3.forcePathStyle = storageCfg.s3ForcePathStyle;
|
||||
}
|
||||
//todo dedicated options?
|
||||
const agent = new Agent(cfgRequestDefaults);
|
||||
//Use separate agents for HTTP and HTTPS
|
||||
const httpsAgent = new HttpsAgent(cfgRequestDefaults);
|
||||
const httpAgent = new HttpAgent(cfgRequestDefaults);
|
||||
configS3.requestHandler = new NodeHttpHandler({
|
||||
httpAgent: agent,
|
||||
httpsAgent: agent
|
||||
httpAgent: httpAgent,
|
||||
httpsAgent: httpsAgent
|
||||
});
|
||||
let configJson = JSON.stringify(configS3);
|
||||
let client = clients[configJson];
|
||||
|
||||
Reference in New Issue
Block a user