From c8c1072cc0d02f6304d22564e42cd51961ea29aa Mon Sep 17 00:00:00 2001 From: buffermet <29265684+buffermet@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:28:58 +0100 Subject: [PATCH] Update dns_proxy_js_query.go --- modules/dns_proxy/dns_proxy_js_query.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 +}