Skip to content

Commit 2464916

Browse files
committed
clean file
1 parent 9d3f9e0 commit 2464916

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

aes_key.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package vault
33
import (
44
"fmt"
55
"os"
6+
"path/filepath"
67
"strings"
78

89
"github.com/jahvon/vault/crypto"
@@ -81,7 +82,7 @@ func (r *KeyResolver) fromFile(path string) (string, error) {
8182
return "", fmt.Errorf("failed to expand key file path %s: %w", path, err)
8283
}
8384

84-
keyBytes, err := os.ReadFile(expandedPath)
85+
keyBytes, err := os.ReadFile(filepath.Clean(expandedPath))
8586
if err != nil {
8687
return "", fmt.Errorf("failed to read key file %s: %w", expandedPath, err)
8788
}

0 commit comments

Comments
 (0)