Compare commits

..

2 Commits

Author SHA1 Message Date
Magnus Åhall
53f4fc363a Trying to fix firefox importmap race condition. 2023-07-18 06:23:51 +02:00
Magnus Åhall
005827e65a Sequential versioning instead of semantic, since it wasn't used correctly anyway. 2023-07-18 06:23:29 +02:00
3 changed files with 9 additions and 4 deletions

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)

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -5,8 +5,6 @@
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/main.css">
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/login.css">
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/sjcl.js"></script>
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/css_reload.js"></script>
<script type="importmap">
{
"imports": {
@ -24,6 +22,8 @@
}
}
</script>
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/sjcl.js"></script>
<script type="text/javascript" src="/js/{{ .VERSION }}/lib/css_reload.js"></script>
</head>
<body>