Merge branch 'dev' into vod
This commit is contained in:
commit
75332ade0a
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user