aboutsummaryrefslogtreecommitdiffstats
path: root/models/publickey.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-18 15:13:08 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-18 15:13:08 -0500
commitce8d4cc80ba908022f0bbaf796b9025cfb68956e (patch)
tree32cee38f40a7ba70fb68c56db23d495cbf5fdfed /models/publickey.go
parent37d8d3afe9ec589574c0cc6380a36fa93b1be8f2 (diff)
downloadgitea-ce8d4cc80ba908022f0bbaf796b9025cfb68956e.tar.gz
gitea-ce8d4cc80ba908022f0bbaf796b9025cfb68956e.zip
#634
Diffstat (limited to 'models/publickey.go')
-rw-r--r--models/publickey.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/models/publickey.go b/models/publickey.go
index f379e12188..29c12c6e3b 100644
--- a/models/publickey.go
+++ b/models/publickey.go
@@ -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")
}