mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
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.
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user