Sequential versioning instead of semantic, since it wasn't used correctly anyway.

This commit is contained in:
Magnus Åhall 2023-07-18 06:23:29 +02:00
parent 7afe8316a9
commit 005827e65a

View File

@ -20,7 +20,7 @@ import (
_ "embed"
)
const VERSION = "v0.3.0";
const VERSION = "v6";
const LISTEN_HOST = "0.0.0.0";
const DB_SCHEMA = 10
@ -112,7 +112,12 @@ func staticHandler(w http.ResponseWriter, r *http.Request) {// {{{
// To get rid of problems with cached content in browser on a new version release,
// while also not disabling cache altogether.
log.Printf("static: %s", r.URL.Path)
rxp := regexp.MustCompile("^/(css|images|js|fonts)/v[0-9]+\\.[0-9]+\\.[0-9]+/(.*)$")
if r.URL.Path == "/favicon.ico" {
static.ServeHTTP(w, r)
return
}
rxp := regexp.MustCompile("^/(css|images|js|fonts)/v[0-9]+/(.*)$")
if comp := rxp.FindStringSubmatch(r.URL.Path); comp != nil {
r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2])
static.ServeHTTP(w, r)