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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user