Merge pull request #1052 from f-kawamura/bugfix-http-git-source

[Bug] Added support for HTTP source URLs in Git source
This commit is contained in:
Andras Bacsai
2023-07-20 13:48:34 +02:00
committed by GitHub

View File

@@ -73,17 +73,19 @@ async function send({
...headers
};
}
if (token && !path.startsWith('https://')) {
if (token && !path.startsWith('https://') && !path.startsWith('http://')) {
opts.headers = {
...opts.headers,
Authorization: `Bearer ${token}`
};
}
if (!path.startsWith('https://')) {
if (!path.startsWith('https://') && !path.startsWith('http://')) {
path = `/api/v1${path}`;
}
if (dev && !path.startsWith('https://')) {
if (dev && !path.startsWith('https://') && !path.startsWith('http://')) {
path = `${getAPIUrl()}${path}`;
}
if (method === 'POST' && data && !opts.body) {