diff --git a/cmd/version.go b/cmd/version.go index 1b34417..fc69a1d 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.8.0" +var Version = "0.8.1" func init() { rootCmd.AddCommand(versionCmd) diff --git a/cmd/web.go b/cmd/web.go index 6156469..d246342 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -136,12 +136,12 @@ func serveHtmlHandler(paths []string) http.HandlerFunc { switch { case r.RequestURI == "/" && Successive && refererUri != "": - f, err := url.QueryUnescape(refererUri) + query, err := url.QueryUnescape(refererUri) if err != nil { log.Fatal(err) } - filePath, err = getNextFile(f) + filePath, err = getNextFile(query) if err != nil { log.Fatal(err) } @@ -189,14 +189,16 @@ func serveHtmlHandler(paths []string) http.HandlerFunc { isImage, err := checkIfImage(filePath) if err != nil { + log.Fatal(err) + } + + if !isImage { http.NotFound(w, r) } - if isImage { - err := serveHtml(w, *r, filePath) - if err != nil { - log.Fatal(err) - } + err = serveHtml(w, *r, filePath) + if err != nil { + log.Fatal(err) } } }