mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-28 05:46:36 +08:00
[fix] anubis
This commit is contained in:
@@ -49,3 +49,4 @@ go.work.sum
|
|||||||
.codex-cache
|
.codex-cache
|
||||||
/.gomodcache/
|
/.gomodcache/
|
||||||
/anubis-1.25.0/
|
/anubis-1.25.0/
|
||||||
|
*.mmdb
|
||||||
@@ -1103,7 +1103,7 @@ func renderPowStaticLocationBlock(powEnabled bool) string {
|
|||||||
if !powEnabled {
|
if !powEnabled {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return fmt.Sprintf(" location %s {\n alias %s/;\n }\n\n", anubisStaticPrefix, nginxPowStaticDirPlaceholder)
|
return fmt.Sprintf(" location %s {\n alias %s/;\n types {\n text/css css;\n application/javascript js mjs;\n application/json json;\n image/webp webp;\n font/woff2 woff2;\n }\n }\n\n", anubisStaticPrefix, nginxPowStaticDirPlaceholder)
|
||||||
}
|
}
|
||||||
|
|
||||||
const anubisStaticPrefix = "/.within.website/x/cmd/anubis/static/"
|
const anubisStaticPrefix = "/.within.website/x/cmd/anubis/static/"
|
||||||
|
|||||||
@@ -986,6 +986,9 @@ func TestPublishConfigVersionDetectsPoWChanges(t *testing.T) {
|
|||||||
if strings.Contains(secondRelease.Version.RenderedConfig, "location /.within.website/x/cmd/anubis/static/static/ {") {
|
if strings.Contains(secondRelease.Version.RenderedConfig, "location /.within.website/x/cmd/anubis/static/static/ {") {
|
||||||
t.Fatal("expected rendered config to avoid duplicate static path segment")
|
t.Fatal("expected rendered config to avoid duplicate static path segment")
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(secondRelease.Version.RenderedConfig, "application/javascript js mjs;") {
|
||||||
|
t.Fatal("expected rendered config to serve Anubis module scripts with a JavaScript MIME type")
|
||||||
|
}
|
||||||
if !strings.Contains(secondRelease.Version.SnapshotJSON, `"difficulty":5`) {
|
if !strings.Contains(secondRelease.Version.SnapshotJSON, `"difficulty":5`) {
|
||||||
t.Fatal("expected snapshot to persist PoW config")
|
t.Fatal("expected snapshot to persist PoW config")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user