mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-01-22 10:55:34 +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 = {};
|
||||
|
||||
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 {
|
||||
await git.clone({
|
||||
fs,
|
||||
@ -59,6 +71,8 @@ export function useGit() {
|
||||
depth: 1,
|
||||
singleBranch: true,
|
||||
corsProxy: '/api/git-proxy',
|
||||
headers,
|
||||
|
||||
onAuth: (url) => {
|
||||
let auth = lookupSavedPassword(url);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user