Merge branch 'dev' into vod

This commit is contained in:
Ingo Oppermann 2023-04-03 10:25:06 +02:00
commit 75332ade0a
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
3 changed files with 22 additions and 0 deletions

View File

@ -14,6 +14,7 @@
- Fix better naming for storage endpoint documentation
- Fix freeing up S3 mounts
- Fix URL validation if the path contains FFmpeg specific placeholders
- Fix purging default file from HTTP cache
### Core v16.11.0 > v16.12.0

View File

@ -165,6 +165,13 @@ func (h *FSHandler) DeleteFile(c echo.Context) error {
if h.FS.Cache != nil {
h.FS.Cache.Delete(path)
if len(h.FS.DefaultFile) != 0 {
if strings.HasSuffix(path, "/"+h.FS.DefaultFile) {
path := strings.TrimSuffix(path, h.FS.DefaultFile)
h.FS.Cache.Delete(path)
}
}
}
return c.String(http.StatusOK, "Deleted: "+path)

View File

@ -58,6 +58,20 @@ func TestReplace(t *testing.T) {
require.Equal(t, "", replaced)
}
func TestReplaceInvalid(t *testing.T) {
r := New()
r.RegisterReplaceFunc(
"foo:bar",
func(params map[string]string, config *app.Config, section string) string {
return "Hello " + params["who"] + "! " + params["what"] + "?"
},
nil,
)
replaced := r.Replace("{foo:bar, who=World}", "foo:bar", "", nil, nil, "")
require.Equal(t, "Hello World! defaultWhat?", replaced)
}
func TestReplacerFunc(t *testing.T) {
r := New()
r.RegisterReplaceFunc(