diff --git a/cmd/root.go b/cmd/root.go
index aca4626..6ba4652 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -17,7 +17,7 @@ var (
)
const (
- Version string = "0.57.3"
+ Version string = "0.57.4"
)
var (
diff --git a/cmd/web.go b/cmd/web.go
index 8996d2f..af38940 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -44,14 +44,19 @@ const (
ImagePrefix string = `/view`
RedirectStatusCode int = http.StatusSeeOther
Timeout time.Duration = 10 * time.Second
-)
-type Stat int
+ FaviconHtml string = `
+
+
+
+
+
+ `
+)
type Regexes struct {
alphanumeric *regexp.Regexp
filename *regexp.Regexp
- units *regexp.Regexp
}
type Filters struct {
@@ -340,25 +345,11 @@ type timesServed struct {
Times []string
}
-func addFavicon() string {
- var htmlBody strings.Builder
-
- htmlBody.WriteString(``)
- htmlBody.WriteString(``)
- htmlBody.WriteString(``)
- htmlBody.WriteString(``)
- htmlBody.WriteString(``)
- htmlBody.WriteString(``)
- htmlBody.WriteString(``)
-
- return htmlBody.String()
-}
-
func newErrorPage(title, body string) string {
var htmlBody strings.Builder
htmlBody.WriteString(`
`)
- htmlBody.WriteString(addFavicon())
+ htmlBody.WriteString(FaviconHtml)
htmlBody.WriteString(``)
htmlBody.WriteString(fmt.Sprintf("%s", title))
htmlBody.WriteString(fmt.Sprintf("%s", body))
@@ -409,7 +400,7 @@ func serverErrorHandler() func(http.ResponseWriter, *http.Request, interface{})
return serverError
}
-func RefreshInterval(r *http.Request, Regexes *Regexes) (int64, string) {
+func RefreshInterval(r *http.Request) (int64, string) {
var interval string
if refreshInterval == "" {
@@ -618,7 +609,7 @@ func serveDebugHtml(args []string, index *Index) httprouter.Handle {
var htmlBody strings.Builder
htmlBody.WriteString(``)
- htmlBody.WriteString(addFavicon())
+ htmlBody.WriteString(FaviconHtml)
htmlBody.WriteString(``)
htmlBody.WriteString(fmt.Sprintf("Index contains %s files", fileCount))
@@ -776,7 +767,7 @@ func serveRoot(paths []string, Regexes *Regexes, index *Index) httprouter.Handle
sortOrder := SortOrder(r)
- _, refreshInterval := RefreshInterval(r, Regexes)
+ _, refreshInterval := RefreshInterval(r)
var filePath string
@@ -890,13 +881,13 @@ func serveImage(paths []string, Regexes *Regexes, index *Index) httprouter.Handl
w.Header().Add("Content-Type", "text/html")
- refreshTimer, refreshInterval := RefreshInterval(r, Regexes)
+ refreshTimer, refreshInterval := RefreshInterval(r)
queryParams := generateQueryParams(filters, sortOrder, refreshInterval)
var htmlBody strings.Builder
htmlBody.WriteString(``)
- htmlBody.WriteString(addFavicon())
+ htmlBody.WriteString(FaviconHtml)
htmlBody.WriteString(`