aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/securitypolicies_test.go
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-09-28 13:15:53 -0700
committerBjørn Erik Pedersen <[email protected]>2024-09-29 10:49:26 +0200
commitd1ba52f3c3bdc31c2067f986fdb57088d875c01e (patch)
tree83bdf861007b0fe4654863a121fb8472d0dc4de3 /hugolib/securitypolicies_test.go
parentd0dca656250d0a04f3a5051ec067022df4b37738 (diff)
downloadhugo-d1ba52f3c3bdc31c2067f986fdb57088d875c01e.tar.gz
hugo-d1ba52f3c3bdc31c2067f986fdb57088d875c01e.zip
tests: Address deprecation warnings and errors
Diffstat (limited to 'hugolib/securitypolicies_test.go')
-rw-r--r--hugolib/securitypolicies_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/hugolib/securitypolicies_test.go b/hugolib/securitypolicies_test.go
index 3ddda7d6a..facda80eb 100644
--- a/hugolib/securitypolicies_test.go
+++ b/hugolib/securitypolicies_test.go
@@ -123,7 +123,7 @@ func TestSecurityPolicies(t *testing.T) {
c.Skip()
}
cb := func(b *sitesBuilder) {
- b.WithTemplatesAdded("index.html", `{{ $scss := "body { color: #333; }" | resources.FromString "foo.scss" | resources.ToCSS (dict "transpiler" "dartsass") }}`)
+ b.WithTemplatesAdded("index.html", `{{ $scss := "body { color: #333; }" | resources.FromString "foo.scss" | css.Sass (dict "transpiler" "dartsass") }}`)
}
testVariant(c, cb, "")
})
@@ -137,10 +137,10 @@ func TestSecurityPolicies(t *testing.T) {
b.WithConfigFile("toml", `
[security]
[security.exec]
-allow="none"
-
+allow="none"
+
`)
- b.WithTemplatesAdded("index.html", `{{ $scss := "body { color: #333; }" | resources.FromString "foo.scss" | resources.ToCSS (dict "transpiler" "dartsass") }}`)
+ b.WithTemplatesAdded("index.html", `{{ $scss := "body { color: #333; }" | resources.FromString "foo.scss" | css.Sass (dict "transpiler" "dartsass") }}`)
}
testVariant(c, cb, `(?s).*sass(-embedded)?" is not whitelisted in policy "security\.exec\.allow".*`)
})
@@ -160,7 +160,7 @@ allow="none"
httpTestVariant(c, `{{ $json := resources.GetRemote "%[1]s/fruits.json" }}{{ $json.Content }}`, `(?s).*is not whitelisted in policy "security\.http\.urls".*`,
func(b *sitesBuilder) {
b.WithConfigFile("toml", `
-[security]
+[security]
[security.http]
urls="none"
`)
@@ -181,7 +181,7 @@ urls="none"
httpTestVariant(c, `{{ $json := resources.GetRemote "%[1]s/fakejson.json" }}{{ $json.Content }}`, ``,
func(b *sitesBuilder) {
b.WithConfigFile("toml", `
-[security]
+[security]
[security.http]
mediaTypes=["application/json"]