Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proxy/server/clientid.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
return false
}
for _, r := range s {
if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9')) {

Check failure on line 47 in proxy/server/clientid.go

View workflow job for this annotation

GitHub Actions / proxy

QF1001: could apply De Morgan's law (staticcheck)
return false
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@
}

// Find profile ID (should be the last part that's alphanumeric)
var profileIDIndex int = -1

Check failure on line 91 in proxy/server/clientid.go

View workflow job for this annotation

GitHub Actions / proxy

QF1011: could omit type int from declaration; it will be inferred from the right-hand side (staticcheck)
for i := len(parts) - 1; i >= 0; i-- {
if isValidProfileID(parts[i]) {
profileIDIndex = i
Expand Down Expand Up @@ -219,7 +219,7 @@
proto,
)
if err == nil && clientID != "" {
zerolog.Info().Str("cliSrvName", cliSrvName).Str("hostSrvName", hostSrvName).Str("clientID", clientID).Str("deviceId", deviceId).Msg("client and server names")
zerolog.Debug().Str("cliSrvName", cliSrvName).Str("hostSrvName", hostSrvName).Str("clientID", clientID).Str("deviceId", deviceId).Msg("client and server names")
return clientID, deviceId, nil
}
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions proxy/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (s *Server) HandleBefore(p *proxy.Proxy, dctx *proxy.DNSContext) (err error

if profileId == "" {
// drop DNS request if profile_id is not provided
systemLogger.Err(errProfileIdNotProvided).Msg(errProfileIdNotProvided.Error())
systemLogger.Warn().Err(errProfileIdNotProvided).Msg(errProfileIdNotProvided.Error())
return errProfileIdNotProvided
} else {
// Layer 2: per-profile rate limit (after profile extraction, before Redis).
Expand Down Expand Up @@ -218,7 +218,7 @@ func (s *Server) HandleBefore(p *proxy.Proxy, dctx *proxy.DNSContext) (err error

// Privacy settings are required — missing means profile doesn't exist.
if settings.PrivacyErr != nil {
systemLogger.Err(settings.PrivacyErr).Msg(errProfileIdNotFound.Error())
systemLogger.Debug().Err(settings.PrivacyErr).Msg(errProfileIdNotFound.Error())
return errProfileIdNotFound
}
prvSettings := settings.Privacy
Expand All @@ -227,7 +227,7 @@ func (s *Server) HandleBefore(p *proxy.Proxy, dctx *proxy.DNSContext) (err error
logsSettings := settings.Logs
var loggingEnabled bool
if settings.LogsErr != nil {
systemLogger.Err(settings.LogsErr).Msg("Error getting profile logs settings, defaulting to enabled")
systemLogger.Warn().Err(settings.LogsErr).Msg("Error getting profile logs settings, defaulting to enabled")
loggingEnabled = true
} else {
loggingEnabled, err = strconv.ParseBool(logsSettings["enabled"])
Expand Down
Loading