fix: Added support for HTTP source URLs in Git source. Currently only support HTTPS

This commit is contained in:
f-kawamura
2023-04-24 16:12:47 +09:00
parent f3beb5d8db
commit 7b05aaffc3

View File

@@ -72,17 +72,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) {