diff options
Diffstat (limited to 'pkg/api/list.go')
-rw-r--r-- | pkg/api/list.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/api/list.go b/pkg/api/list.go index 812bb0f..80a34ea 100644 --- a/pkg/api/list.go +++ b/pkg/api/list.go @@ -3,6 +3,7 @@ package api import ( "fmt" "net/http" + "strings" ) func (a *API) getListHandler(w http.ResponseWriter, r *http.Request) { @@ -17,6 +18,12 @@ func (a *API) getListHandler(w http.ResponseWriter, r *http.Request) { } } -func (a *API) getBlacklistTxtHandler(w http.ResponseWriter, r *http.Request) { - // TODO +func (a *API) getBlacklistHandler(w http.ResponseWriter, r *http.Request) { + list, err := a.idec.GetBlacklist() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + fmt.Fprint(w, strings.Join(list, "\n")) } |