mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
This commit is contained in:
1 parent
37d8d3afe9
commit
ce8d4cc80b
4 files changed
+57
-44
No files matched your search
@@ -108,6 +108,7 @@ var (
|
||||
|
||||
// CheckPublicKeyString checks if the given public key string is recognized by SSH.
|
||||
func CheckPublicKeyString(content string) (bool, error) {
|
||||
content = strings.TrimRight(content, "\n\r")
|
||||
if strings.ContainsAny(content, "\n\r") {
|
||||
return false, errors.New("only a single line with a single key please")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user