diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-18 15:13:08 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-18 15:13:08 -0500 |
commit | ce8d4cc80ba908022f0bbaf796b9025cfb68956e (patch) | |
tree | 32cee38f40a7ba70fb68c56db23d495cbf5fdfed /models/publickey.go | |
parent | 37d8d3afe9ec589574c0cc6380a36fa93b1be8f2 (diff) | |
download | gitea-ce8d4cc80ba908022f0bbaf796b9025cfb68956e.tar.gz gitea-ce8d4cc80ba908022f0bbaf796b9025cfb68956e.zip |
#634
Diffstat (limited to 'models/publickey.go')
-rw-r--r-- | models/publickey.go | 1 |
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") } |