Browse Source

Fix extension handling

master
Chris Smith 5 years ago
parent
commit
a14bfec362
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      certs/monitor.go

+ 2
- 1
certs/monitor.go View File

@@ -58,8 +58,9 @@ func (c *CertificateMonitor) scanForCerts(vhost string, dir string) {
58 58
 	for _, f := range files {
59 59
 		ext := path.Ext(f.Name())
60 60
 		base := path.Base(f.Name())
61
+		base = base[:len(base)-len(ext)]
61 62
 		c.logger.Debugf("File %s has extension %s, base name %s", f.Name(), ext, base)
62
-		if ext == "pem" {
63
+		if ext == ".pem" {
63 64
 			prefix := strings.Split(base, "-")[0]
64 65
 			added := maybeAddPart(&cert, prefix, path.Join(dir, f.Name()))
65 66
 			c.logger.Debugf("\tFile prefix is %s, added status %s", prefix, added)

Loading…
Cancel
Save