diff --git a/modules/dns_proxy/dns_proxy_js_query.go b/modules/dns_proxy/dns_proxy_js_query.go index 64ea9052..c726c80f 100644 --- a/modules/dns_proxy/dns_proxy_js_query.go +++ b/modules/dns_proxy/dns_proxy_js_query.go @@ -324,3 +324,11 @@ func (j *JSQuery) WasModified() bool { // check if any of the fields has been changed return j.NewHash() != j.refHash } + +func (j *JSQuery) CheckIfModifiedAndUpdateHash() bool { + // check if query was changed and update its hash + newHash := j.NewHash() + wasModified := j.refHash != newHash + j.refHash = newHash + return wasModified +}