This commit is contained in:
@@ -2,6 +2,7 @@ package htpasswd
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -12,7 +13,7 @@ type (
|
||||
)
|
||||
|
||||
func Open(path string) (File, error) {
|
||||
c, err := os.ReadFile(path)
|
||||
c, err := os.ReadFile(filepath.Clean(path))
|
||||
if err != nil {
|
||||
return File{}, err
|
||||
}
|
||||
@@ -26,7 +27,7 @@ func Open(path string) (File, error) {
|
||||
if len(kv) != 2 {
|
||||
continue
|
||||
}
|
||||
f.data[kv[0]] = kv[1]
|
||||
f.data[kv[0]] = kv[1]
|
||||
}
|
||||
|
||||
return f, nil
|
||||
|
||||
Reference in New Issue
Block a user