1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-06 00:26:19 +02:00

certificate.Store: Clean scope path in Load

Clean the scope path so that trimming the path from the scope works for
relative paths.
This commit is contained in:
Adnan Maolood 2021-03-05 10:51:53 -05:00
parent 649b20659b
commit e7a06a12bf

View File

@ -191,7 +191,8 @@ func (s *Store) Load(path string) error {
continue
}
scope := strings.TrimPrefix(crtPath, path)
scope := filepath.Clean(crtPath)
scope = strings.TrimPrefix(crtPath, filepath.Clean(path))
scope = strings.TrimPrefix(scope, "/")
scope = strings.TrimSuffix(scope, ".crt")
s.Add(scope, cert)