mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
move IP/Network lists to the data provider
this is a backward incompatible change, all previous file based IP/network lists will not work anymore Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/go-chi/render"
|
||||
|
||||
@@ -82,7 +83,7 @@ func addEventAction(w http.ResponseWriter, r *http.Request) {
|
||||
sendAPIResponse(w, r, err, "", getRespStatus(err))
|
||||
return
|
||||
}
|
||||
w.Header().Add("Location", fmt.Sprintf("%s/%s", eventActionsPath, action.Name))
|
||||
w.Header().Add("Location", fmt.Sprintf("%s/%s", eventActionsPath, url.PathEscape(action.Name)))
|
||||
renderEventAction(w, r, action.Name, http.StatusCreated)
|
||||
}
|
||||
|
||||
@@ -197,7 +198,7 @@ func addEventRule(w http.ResponseWriter, r *http.Request) {
|
||||
sendAPIResponse(w, r, err, "", getRespStatus(err))
|
||||
return
|
||||
}
|
||||
w.Header().Add("Location", fmt.Sprintf("%s/%s", eventRulesPath, rule.Name))
|
||||
w.Header().Add("Location", fmt.Sprintf("%s/%s", eventRulesPath, url.PathEscape(rule.Name)))
|
||||
renderEventRule(w, r, rule.Name, http.StatusCreated)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user