request.Match check Response bit as well (#1775)

* request.Match check Response bit as well

We should check this bit and reject them as invalid.

* Fix test
This commit is contained in:
Miek Gieben 2018-05-09 12:35:42 +01:00 committed by GitHub
parent 68b45f5377
commit 0e5e59c327
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 4 deletions

View file

@ -130,7 +130,6 @@ func (w *ResponseWriter) WriteMsg(res *dns.Msg) error {
}
if key != -1 && duration > 0 {
if w.state.Match(res) {
w.set(res, key, mt, duration)
cacheSize.WithLabelValues(w.server, Success).Set(float64(w.pcache.Len()))