Skip to content

Commit

Permalink
querylog: imp code, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Jun 29, 2021
1 parent 8aa6242 commit eecfc98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ and this project adheres to

### Changed

- Query log search is now supports internationalized domains ([#3012]).
- Query log search now supports internationalized domains ([#3012]).
- Internationalized domains are now shown decoded in the query log with the
original encoded version shown in request details. ([#3013]).
- When /etc/hosts-type rules have several IPs for one host, all IPs are now
Expand Down
9 changes: 3 additions & 6 deletions internal/querylog/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,16 @@ func (l *queryLog) parseSearchCriterion(q url.Values, name string, ct criterionT
return false, sc, nil
}

var strict bool
if getDoubleQuotesEnclosedValue(&val) {
strict = true
}
strict := getDoubleQuotesEnclosedValue(&val)

var asciiVal string
switch ct {
case ctTerm:
if asciiVal, err = idna.ToASCII(val); err != nil {
log.Debug("can't convert %q to ascii: %s", val, err)
} else if asciiVal == val {
// asciiVal is purged here to prevent checking the same
// value twice.
// Purge asciiVal to prevent checking the same value
// twice.
asciiVal = ""
}
case ctFilteringStatus:
Expand Down
4 changes: 2 additions & 2 deletions internal/querylog/searchcriterion.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type criterionType int

const (
// ctTerm is for searching by the domain name, the client's IP address,
// the client's ID or the client's name. The domain names are support
// internationalization.
// the client's ID or the client's name. The domain name search
// supports IDNAs.
ctTerm criterionType = iota
// ctFilteringStatus is for searching by the filtering status.
//
Expand Down

0 comments on commit eecfc98

Please sign in to comment.