Add custom filter for DWS and Tanishq Dubey trademarks
- Create custom_filter.go with DWS/Tanishq Dubey term detection - Block variations including: - DWS, Dubey Web Services, DWS Engineering LLC - Tanishq Dubey, tdubey - Leet speak variations (dub3y, t4nishq, dw5, etc.) - Combined terms (dubeydns, dws-ddns, etc.) - Update frontend to show 'reserved' message for blocked terms - Filters are case-insensitive and handle separators Protects brand identity and personal name from being used in user subdomains
This commit is contained in:
@@ -16,7 +16,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var profanityDetector = goaway.NewProfanityDetector()
|
||||
var (
|
||||
profanityDetector = goaway.NewProfanityDetector()
|
||||
customFilter = NewCustomFilter()
|
||||
)
|
||||
|
||||
type WebHandler struct {
|
||||
db *database.DB
|
||||
@@ -57,6 +60,11 @@ func (h *WebHandler) ClaimSpace(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if customFilter.IsBlocked(subdomain) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "Subdomain is reserved"})
|
||||
return
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
@@ -103,6 +111,15 @@ func (h *WebHandler) CheckSubdomain(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if customFilter.IsBlocked(subdomain) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"available": false,
|
||||
"subdomain": subdomain,
|
||||
"reason": "reserved",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user