mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-25 01:21:48 +00:00
fix(s3-backend): correct endpoint
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
220bb31f0c
commit
a72f695124
1 changed files with 1 additions and 2 deletions
|
@ -29,13 +29,12 @@ export class S3Backend implements MediaBackend {
|
|||
this.config = mediaConfig.backend.s3;
|
||||
const url = new URL(this.config.endPoint);
|
||||
const secure = url.protocol === 'https:'; // url.protocol contains a trailing ':'
|
||||
const endpoint = `${url.hostname}${url.pathname}`;
|
||||
let port = parseInt(url.port);
|
||||
if (isNaN(port)) {
|
||||
port = secure ? 443 : 80;
|
||||
}
|
||||
this.client = new Client({
|
||||
endPoint: endpoint.substr(0, endpoint.length - 1), // remove trailing '/'
|
||||
endPoint: url.hostname,
|
||||
port: port,
|
||||
useSSL: secure,
|
||||
accessKey: this.config.accessKeyId,
|
||||
|
|
Loading…
Reference in a new issue