From e5f229974166402f51e4ee0695ffb4d1e09fa174 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Thu, 25 Jul 2019 00:12:40 +0200 Subject: Block symlink dir traversal for /static This is in line with how it behaved before, but it was lifted a little for the project mount for Hugo Modules, but that could create hard-to-detect loops. --- source/content_directory_test.go | 2 +- source/filesystem_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/content_directory_test.go b/source/content_directory_test.go index 7f050e0da..46fd7813e 100644 --- a/source/content_directory_test.go +++ b/source/content_directory_test.go @@ -54,7 +54,7 @@ func TestIgnoreDotFilesAndDirectories(t *testing.T) { v := newTestConfig() v.Set("ignoreFiles", test.ignoreFilesRegexpes) fs := hugofs.NewMem(v) - ps, err := helpers.NewPathSpec(fs, v) + ps, err := helpers.NewPathSpec(fs, v, nil) assert.NoError(err) s := NewSourceSpec(ps, fs.Source) diff --git a/source/filesystem_test.go b/source/filesystem_test.go index 33007c7e4..fd3ff1952 100644 --- a/source/filesystem_test.go +++ b/source/filesystem_test.go @@ -103,7 +103,7 @@ func newTestConfig() *viper.Viper { func newTestSourceSpec() *SourceSpec { v := newTestConfig() fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(afero.NewMemMapFs()), v) - ps, err := helpers.NewPathSpec(fs, v) + ps, err := helpers.NewPathSpec(fs, v, nil) if err != nil { panic(err) } -- cgit v1.2.3