Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spikelu2016 committed Aug 31, 2024
1 parent bd64d6e commit c7ae18b
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions internal/server/web/proxy/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,13 @@ func getMiddleware(cpm CustomProvidersManager, rm routeManager, pm PoliciesManag
return
}

for _, ip := range blockList {
fmt.Println(c.Request.RemoteAddr)
fmt.Println(c.Request.RemoteAddr)
fmt.Println(c.Request.UserAgent())

if strings.Contains(c.Request.RemoteAddr, ip) {
telemetry.Incr("bricksllm.proxy.get_middleware.first_block", nil, 1)
c.Status(200)
return
}

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

if removeUserAgent {
Expand Down

0 comments on commit c7ae18b

Please sign in to comment.