mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 13:42:17 +01:00
Better URL scheme for manipulating bannedips, now just have single dir that you can POST or DELETE to
This commit is contained in:
parent
67aa38de0d
commit
149fb451a6
1 changed files with 5 additions and 3 deletions
8
jail.go
8
jail.go
|
@ -63,12 +63,14 @@ func jailUnbanIPHandler(res http.ResponseWriter, req *http.Request, fail2goConn
|
||||||
}
|
}
|
||||||
|
|
||||||
func jailHandler(jailRouter *mux.Router, fail2goConn *fail2go.Fail2goConn) {
|
func jailHandler(jailRouter *mux.Router, fail2goConn *fail2go.Fail2goConn) {
|
||||||
jailRouter.HandleFunc("/{jail}/banip", func(res http.ResponseWriter, req *http.Request) {
|
|
||||||
|
jailRouter.HandleFunc("/{jail}/bannedips", func(res http.ResponseWriter, req *http.Request) {
|
||||||
jailBanIPHandler(res, req, fail2goConn)
|
jailBanIPHandler(res, req, fail2goConn)
|
||||||
}).Methods("POST")
|
}).Methods("POST")
|
||||||
jailRouter.HandleFunc("/{jail}/unbanip", func(res http.ResponseWriter, req *http.Request) {
|
jailRouter.HandleFunc("/{jail}/bannedips", func(res http.ResponseWriter, req *http.Request) {
|
||||||
jailUnbanIPHandler(res, req, fail2goConn)
|
jailUnbanIPHandler(res, req, fail2goConn)
|
||||||
}).Methods("POST")
|
}).Methods("DELETE")
|
||||||
|
|
||||||
jailRouter.HandleFunc("/{jail}", func(res http.ResponseWriter, req *http.Request) {
|
jailRouter.HandleFunc("/{jail}", func(res http.ResponseWriter, req *http.Request) {
|
||||||
jailGetHandler(res, req, fail2goConn)
|
jailGetHandler(res, req, fail2goConn)
|
||||||
}).Methods("GET")
|
}).Methods("GET")
|
||||||
|
|
Loading…
Reference in a new issue