mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
fix: git private clone with custom proxy (#1010)
* cookie fix * fix: git private clone with custom proxy * list -fix
This commit is contained in:
parent
b1f9380c30
commit
59cae5733d
@ -50,6 +50,18 @@ export function useGit() {
|
|||||||
|
|
||||||
fileData.current = {};
|
fileData.current = {};
|
||||||
|
|
||||||
|
const headers: {
|
||||||
|
[x: string]: string;
|
||||||
|
} = {
|
||||||
|
'User-Agent': 'bolt.diy',
|
||||||
|
};
|
||||||
|
|
||||||
|
const auth = lookupSavedPassword(url);
|
||||||
|
|
||||||
|
if (auth) {
|
||||||
|
headers.Authorization = `Basic ${Buffer.from(`${auth.username}:${auth.password}`).toString('base64')}`;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await git.clone({
|
await git.clone({
|
||||||
fs,
|
fs,
|
||||||
@ -59,6 +71,8 @@ export function useGit() {
|
|||||||
depth: 1,
|
depth: 1,
|
||||||
singleBranch: true,
|
singleBranch: true,
|
||||||
corsProxy: '/api/git-proxy',
|
corsProxy: '/api/git-proxy',
|
||||||
|
headers,
|
||||||
|
|
||||||
onAuth: (url) => {
|
onAuth: (url) => {
|
||||||
let auth = lookupSavedPassword(url);
|
let auth = lookupSavedPassword(url);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user