Adding has protocol function and using that.
This commit is contained in:
parent
e7f42a0075
commit
8ea25418b9
|
@ -247,3 +247,7 @@ export function hasCircularStructure(json: any) {
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function urlHasProtocol(url: string): boolean {
|
||||||
|
return !!url.match(/^.+:\/\/.+$/)
|
||||||
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@
|
||||||
"@types/tar": "6.1.5",
|
"@types/tar": "6.1.5",
|
||||||
"@types/tmp": "0.2.6",
|
"@types/tmp": "0.2.6",
|
||||||
"@types/uuid": "8.3.4",
|
"@types/uuid": "8.3.4",
|
||||||
|
"@smithy/types": "4.0.0",
|
||||||
"chance": "^1.1.12",
|
"chance": "^1.1.12",
|
||||||
"copyfiles": "2.4.1",
|
"copyfiles": "2.4.1",
|
||||||
"docker-compose": "0.23.17",
|
"docker-compose": "0.23.17",
|
||||||
|
|
|
@ -340,7 +340,7 @@ export const getSignedUploadURL = async function (
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let endpoint = datasource?.config?.endpoint
|
let endpoint = datasource?.config?.endpoint
|
||||||
if (endpoint && !endpoint.startsWith("http")) {
|
if (endpoint && !utils.urlHasProtocol(endpoint)) {
|
||||||
endpoint = `https://${endpoint}`
|
endpoint = `https://${endpoint}`
|
||||||
}
|
}
|
||||||
const s3 = new S3({
|
const s3 = new S3({
|
||||||
|
|
Loading…
Reference in New Issue