Removed redundant isImage check
This commit is contained in:
parent
30eead7e2f
commit
d869a375ab
|
@ -17,7 +17,7 @@ var (
|
|||
)
|
||||
|
||||
const (
|
||||
Version string = "0.59.3"
|
||||
Version string = "0.59.4"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
12
cmd/web.go
12
cmd/web.go
|
@ -990,10 +990,7 @@ func serveImage(paths []string, Regexes *Regexes, index *Index) httprouter.Handl
|
|||
return
|
||||
}
|
||||
|
||||
var dimensions *Dimensions
|
||||
|
||||
if image {
|
||||
dimensions, err = imageDimensions(filePath)
|
||||
dimensions, err := imageDimensions(filePath)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
||||
|
@ -1001,7 +998,6 @@ func serveImage(paths []string, Regexes *Regexes, index *Index) httprouter.Handl
|
|||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
fileName := filepath.Base(filePath)
|
||||
|
||||
|
@ -1114,7 +1110,7 @@ func ServePage(args []string) error {
|
|||
list: []string{},
|
||||
}
|
||||
|
||||
Regexes := &Regexes{
|
||||
regexes := &Regexes{
|
||||
filename: regexp.MustCompile(`(.+)([0-9]{3})(\..+)`),
|
||||
alphanumeric: regexp.MustCompile(`^[A-z0-9]*$`),
|
||||
}
|
||||
|
@ -1137,13 +1133,13 @@ func ServePage(args []string) error {
|
|||
|
||||
mux.PanicHandler = serverErrorHandler()
|
||||
|
||||
mux.GET("/", serveRoot(paths, Regexes, index))
|
||||
mux.GET("/", serveRoot(paths, regexes, index))
|
||||
|
||||
mux.GET("/favicons/*favicon", serveFavicons())
|
||||
|
||||
mux.GET("/favicon.ico", serveFavicons())
|
||||
|
||||
mux.GET(ImagePrefix+"/*image", serveImage(paths, Regexes, index))
|
||||
mux.GET(ImagePrefix+"/*image", serveImage(paths, regexes, index))
|
||||
|
||||
mux.GET(SourcePrefix+"/*static", serveStaticFile(paths, stats, index))
|
||||
|
||||
|
|
Loading…
Reference in New Issue