Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Megalonia committed Aug 7, 2023
1 parent 7b74eda commit 40cfc08
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions config/user_agent_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import (
)

// UserAgentFilter is a pair of strings slices that allow/deny traffic to an endpoint
// and 2 boolean flags that either allow empty user agents or use a
// ngrok defined deny list
type userAgentFilter struct {
// slice of regex strings for allowed user agents
Allow []string
// slice of regex strings for denied user agents
Deny []string
// description of what users have defined
}

func (b *userAgentFilter) toProtoConfig() *pb.MiddlewareConfiguration_UserAgentFilter {
Expand All @@ -25,7 +22,7 @@ func (b *userAgentFilter) toProtoConfig() *pb.MiddlewareConfiguration_UserAgentF
}
}

// WithUserAgentFilter configures botfilter from a set passed parameters.
// WithUserAgentFilter configures user-agent filter from passed parameters.
func WithUserAgentFilter(allow []string, deny []string) HTTPEndpointOption {
return httpOptionFunc(func(cfg *httpOptions) {
cfg.UserAgentFilter = &userAgentFilter{
Expand Down

0 comments on commit 40cfc08

Please sign in to comment.