Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Jan 20, 2025
1 parent a39dde9 commit 3d010e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)

const (
Expand All @@ -25,7 +25,7 @@ const (
// URL2filename translates a given URL path to a probable full filename
func URL2filename(dirname, urlpath string) string {
if strings.Contains(urlpath, "..") {
log.Warn("Someone was trying to access a directory with .. in the URL")
logrus.Warn("Someone was trying to access a directory with .. in the URL")
return dirname + Pathsep
}
if strings.HasPrefix(urlpath, "/") {
Expand All @@ -41,7 +41,7 @@ func URL2filename(dirname, urlpath string) string {
func GetFilenames(dirname string) []string {
dir, err := os.Open(dirname)
if err != nil {
log.WithFields(log.Fields{
logrus.WithFields(logrus.Fields{
"dirname": dirname,
"error": err.Error(),
}).Error("Could not open directory")
Expand All @@ -50,7 +50,7 @@ func GetFilenames(dirname string) []string {
defer dir.Close()
filenames, err := dir.Readdirnames(-1)
if err != nil {
log.WithFields(log.Fields{
logrus.WithFields(logrus.Fields{
"dirname": dirname,
"error": err.Error(),
}).Error("Could not read filenames from directory")
Expand Down

0 comments on commit 3d010e4

Please sign in to comment.