mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-25 13:31:15 +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;
|
this.config = mediaConfig.backend.s3;
|
||||||
const url = new URL(this.config.endPoint);
|
const url = new URL(this.config.endPoint);
|
||||||
const secure = url.protocol === 'https:'; // url.protocol contains a trailing ':'
|
const secure = url.protocol === 'https:'; // url.protocol contains a trailing ':'
|
||||||
const endpoint = `${url.hostname}${url.pathname}`;
|
|
||||||
let port = parseInt(url.port);
|
let port = parseInt(url.port);
|
||||||
if (isNaN(port)) {
|
if (isNaN(port)) {
|
||||||
port = secure ? 443 : 80;
|
port = secure ? 443 : 80;
|
||||||
}
|
}
|
||||||
this.client = new Client({
|
this.client = new Client({
|
||||||
endPoint: endpoint.substr(0, endpoint.length - 1), // remove trailing '/'
|
endPoint: url.hostname,
|
||||||
port: port,
|
port: port,
|
||||||
useSSL: secure,
|
useSSL: secure,
|
||||||
accessKey: this.config.accessKeyId,
|
accessKey: this.config.accessKeyId,
|
||||||
|
|
Loading…
Reference in a new issue