From c9f6554952041f6879ef44c6ec391e7ae2467694 Mon Sep 17 00:00:00 2001 From: paspo Date: Mon, 24 Mar 2025 14:54:52 +0100 Subject: [PATCH] listed status as boolean --- src/cmd/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/main.go b/src/cmd/main.go index d70cec9..fb535c5 100644 --- a/src/cmd/main.go +++ b/src/cmd/main.go @@ -62,7 +62,7 @@ func RBLLookupIP(c *gin.Context) { listed = "listed" if err == nil { - c.JSON(http.StatusOK, gin.H{"status": listed, "query": q}) + c.JSON(http.StatusOK, gin.H{"status": listed, "listed": true, "query": q}) return } @@ -90,7 +90,7 @@ func RBLLookupIP(c *gin.Context) { listed = "not listed" } - c.JSON(http.StatusOK, gin.H{"status": listed, "query": q}) + c.JSON(http.StatusOK, gin.H{"status": listed, "listed": !dnsErr.IsNotFound, "query": q}) } func initResolver() {