1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00
This commit is contained in:
Unknwon
2014-11-18 15:13:08 -05:00
parent 37d8d3afe9
commit ce8d4cc80b
4 changed files with 57 additions and 44 deletions

View File

@@ -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")
}