Skip to content

Commit

Permalink
remove
Browse files Browse the repository at this point in the history
  • Loading branch information
spikelu2016 committed Aug 31, 2024
1 parent 66a3a0a commit e34416f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions internal/server/web/proxy/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ type CustomPolicyDetector interface {
Detect(input []string, requirements []string) (bool, error)
}

var blockList = []string{"43.130.32.143"}

func getMiddleware(cpm CustomProvidersManager, rm routeManager, pm PoliciesManager, a authenticator, prod, private bool, log *zap.Logger, pub publisher, prefix string, ac accessCache, uac userAccessCache, client http.Client, scanner Scanner, cd CustomPolicyDetector, um userManager, removeUserAgent bool) gin.HandlerFunc {
return func(c *gin.Context) {
if c == nil || c.Request == nil {
Expand All @@ -183,16 +181,6 @@ func getMiddleware(cpm CustomProvidersManager, rm routeManager, pm PoliciesManag
return
}

fmt.Println(c.Request.RemoteAddr)
fmt.Println(c.Request.UserAgent())

if strings.HasPrefix(c.Request.UserAgent(), "Go-http-client") {
telemetry.Incr("bricksllm.proxy.get_middleware.block_by_client", nil, 1)
c.Status(200)
c.Abort()
return
}

if removeUserAgent {
c.Set("removeUserAgent", removeUserAgent)
}
Expand Down

0 comments on commit e34416f

Please sign in to comment.