We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ae10cb commit 29aea36Copy full SHA for 29aea36
templates/repo/clone_script.tmpl
@@ -17,7 +17,14 @@
17
const btn = isSSH ? sshBtn : httpsBtn;
18
if (!btn) return;
19
20
- const link = btn.getAttribute('data-link');
+ let link = btn.getAttribute('data-link');
21
+ if (link.startsWith('http://') || link.startsWith('https://')) {
22
+ // use current protocol/host as the clone link
23
+ const url = new URL(link);
24
+ url.protocol = window.location.protocol;
25
+ url.host = window.location.host;
26
+ link = url.toString();
27
+ }
28
for (const el of document.getElementsByClassName('js-clone-url')) {
29
el[el.nodeName === 'INPUT' ? 'value' : 'textContent'] = link;
30
}
0 commit comments