mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Allow cloning from GitHub/GitLab with corsProxy
This commit is contained in:
1 file changed
+6
@@ -40,6 +40,7 @@ export class ProjectsManager {
|
||||
}
|
||||
|
||||
async cloneProject(name: string, repoUrl: string): Promise<Project> {
|
||||
const url = new URL(repoUrl);
|
||||
const id = await this.generateUniqueProjectId(name);
|
||||
const projectPath = `${this.dir}/${id}`;
|
||||
|
||||
@@ -53,6 +54,11 @@ export class ProjectsManager {
|
||||
url: repoUrl,
|
||||
singleBranch: true,
|
||||
depth: 1,
|
||||
// Use the CORS proxy only for GitHub and GitLab URLs
|
||||
// More info: https://github.com/isomorphic-git/isomorphic-git#cors-support
|
||||
corsProxy: url.hostname === 'github.com' || url.hostname === 'gitlab.com'
|
||||
? 'https://cors.isomorphic-git.org'
|
||||
: undefined,
|
||||
});
|
||||
|
||||
// Get filesystem stats for timestamps
|
||||
|
||||
Reference in new issue
Block a user