feat: add file upload support for file handler (issue #854)

Add PUT method support to the file:// handler, allowing file uploads via
curl -T. Upload is opt-in, disabled by default — enable with ?put=true
metadata flag. Includes path traversal protection.
This commit is contained in:
ginuerzh
2026-05-31 22:48:17 +08:00
parent dd19e4387a
commit 5a09a48b2d
2 changed files with 64 additions and 1 deletions
+2
View File
@@ -7,9 +7,11 @@ import (
type metadata struct {
dir string
put bool
}
func (h *fileHandler) parseMetadata(md mdata.Metadata) (err error) {
h.md.dir = mdutil.GetString(md, "file.dir", "dir")
h.md.put = mdutil.GetBool(md, "file.put", "put")
return
}