mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 07:30:25 +00:00
eventmanager: replace placeholders in multipart filename
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
6395fa0b67
commit
163662a65a
1 changed files with 2 additions and 1 deletions
|
@ -1336,7 +1336,8 @@ func getHTTPRuleActionBody(c *dataprovider.EventActionHTTPConfig, replacer *stri
|
||||||
} else {
|
} else {
|
||||||
h.Set("Content-Disposition",
|
h.Set("Content-Disposition",
|
||||||
fmt.Sprintf(`form-data; name="%s"; filename="%s"`,
|
fmt.Sprintf(`form-data; name="%s"; filename="%s"`,
|
||||||
multipartQuoteEscaper.Replace(part.Name), multipartQuoteEscaper.Replace(path.Base(part.Filepath))))
|
multipartQuoteEscaper.Replace(part.Name),
|
||||||
|
multipartQuoteEscaper.Replace((path.Base(replaceWithReplacer(part.Filepath, replacer))))))
|
||||||
contentType := mime.TypeByExtension(path.Ext(part.Filepath))
|
contentType := mime.TypeByExtension(path.Ext(part.Filepath))
|
||||||
if contentType == "" {
|
if contentType == "" {
|
||||||
contentType = "application/octet-stream"
|
contentType = "application/octet-stream"
|
||||||
|
|
Loading…
Reference in a new issue