mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-26 07:19:28 +02:00
Quick quit ssh://
This commit is contained in:
@@ -91,6 +91,9 @@ func IsRemoteNotExistError(err error) bool {
|
||||
|
||||
// normalizeSSHURL converts SSH-SCP format URLs to standard ssh:// format for security
|
||||
func normalizeSSHURL(remoteAddr string) (string, error) {
|
||||
if strings.HasPrefix(remoteAddr, "ssh://") {
|
||||
return remoteAddr, nil
|
||||
}
|
||||
if strings.Contains(remoteAddr, "://") {
|
||||
return remoteAddr, errors.New("remoteAddr has a scheme")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user