From 1f8e97d91fbb67570c5d44e1c5c0442e497d7d09 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Tue, 27 Mar 2018 12:33:44 +0200 Subject: [PATCH] fix: fixed a bug which caused response body overrides from proxy modules to not work correctly in some cases (fixes #209) --- modules/http_proxy_js_response.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/http_proxy_js_response.go b/modules/http_proxy_js_response.go index cea84cb1..c7469bc4 100644 --- a/modules/http_proxy_js_response.go +++ b/modules/http_proxy_js_response.go @@ -64,10 +64,14 @@ func (j *JSResponse) UpdateHash() { } func (j *JSResponse) WasModified() bool { - // body was read if j.bodyRead == true { + // body was read + return true + } else if j.Body != "" { + // body was not read but just set return true } + // check if any of the fields has been changed newHash := j.NewHash() if newHash != j.refHash {