summaryrefslogtreecommitdiff
path: root/pkg/api/list.go
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-20 20:38:08 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-20 20:38:08 +0300
commitb26bd10926447ed59cbf263aef087bb7c04f35eb (patch)
treed813a4bcfb6ae04be95966492e9c5d5963f3c90f /pkg/api/list.go
parentd9e19fc53fb386f4160b8c3e9d7c35aa217d9591 (diff)
Добавил /x/file*
Добавил Dockerfile
Diffstat (limited to 'pkg/api/list.go')
-rw-r--r--pkg/api/list.go11
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"))
}