Skip to content

Commit a71747e

Browse files
committed
add templating debug logs
1 parent c22d1f7 commit a71747e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internals/proxy/proxy.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TemplatingMiddleware(next http.Handler, VARIABLES map[string]string) http.H
156156

157157
modifiedBodyBytes := []byte(modifiedBody)
158158

159-
if req.URL.Query() != nil {
159+
if req.URL.RawQuery != "" {
160160
var modifiedBodyData map[string]interface{}
161161

162162
err = json.Unmarshal(modifiedBodyBytes, &modifiedBodyData)
@@ -192,8 +192,12 @@ func TemplatingMiddleware(next http.Handler, VARIABLES map[string]string) http.H
192192
http.Error(w, "Internal Error", http.StatusInternalServerError)
193193
return
194194
}
195+
196+
log.Debug("Applied Query Templating: ", query)
195197
}
196198

199+
log.Debug("Applied Body Templating")
200+
197201
req.Body = io.NopCloser(bytes.NewReader(modifiedBodyBytes))
198202

199203
req.ContentLength = int64(len(modifiedBody))

0 commit comments

Comments
 (0)