From cd902c6688f678c2fb583f10230dc3b92261a319 Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 23 Oct 2024 10:51:15 +0200 Subject: [PATCH] method --- tools/remote_caller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/remote_caller.go b/tools/remote_caller.go index b6aac28..a6bd595 100644 --- a/tools/remote_caller.go +++ b/tools/remote_caller.go @@ -121,7 +121,7 @@ func (caller *HTTPCaller) CallPut(url string, subpath string, body map[string]in } // CallRaw calls the Raw method on the HTTP server -func (caller *HTTPCaller) CallRaw(method string, url string, subpath string, body map[string]interface{}, content_type string) (*http.Response, error) { +func (caller *HTTPCaller) CallRaw(method string, url string, subpath string, body map[string]interface{}, content_type string, fakeTLSTermination bool) (*http.Response, error) { postBody, _ := json.Marshal(body) responseBody := bytes.NewBuffer(postBody) req, err := http.NewRequest(method, url+subpath, responseBody) @@ -129,6 +129,9 @@ func (caller *HTTPCaller) CallRaw(method string, url string, subpath string, bod return nil, err } req.Header.Set("Content-Type", content_type) + if fakeTLSTermination { + req.Header.Add("X-Forwarded-Proto", "https") + } client := &http.Client{} return client.Do(req) }