mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2025-01-03 11:22:13 +01:00
Also update for fail regexes
Update for fail regexes too (same issue as IPList)
This commit is contained in:
parent
7afc5881d0
commit
ea2e39581d
1 changed files with 4 additions and 0 deletions
4
jail.go
4
jail.go
|
@ -18,6 +18,10 @@ func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fai
|
||||||
if IPList == nil {
|
if IPList == nil {
|
||||||
IPList = []string{}
|
IPList = []string{}
|
||||||
}
|
}
|
||||||
|
//If failRegexes is nil/null/doesn't exist, then initialize it to an empty string array. This resolves the front end issue where a null value is trying to be parsed for the list of regular expressions.
|
||||||
|
if(failRegexes == nil {
|
||||||
|
failRegexes = []string{}
|
||||||
|
}
|
||||||
|
|
||||||
encodedOutput, err := json.Marshal(map[string]interface{}{
|
encodedOutput, err := json.Marshal(map[string]interface{}{
|
||||||
"currentlyFailed": currentlyFailed,
|
"currentlyFailed": currentlyFailed,
|
||||||
|
|
Loading…
Reference in a new issue