summaryrefslogtreecommitdiffstats
path: root/models/ssh_key.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r--models/ssh_key.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go
index 69699f24c1..f441c3e42c 100644
--- a/models/ssh_key.go
+++ b/models/ssh_key.go
@@ -107,7 +107,7 @@ func parseKeyString(content string) (string, error) {
var keyType, keyContent, keyComment string
- if content[:len(ssh2keyStart)] == ssh2keyStart {
+ if strings.HasPrefix(content, ssh2keyStart) {
// Parse SSH2 file format.
// Transform all legal line endings to a single "\n".