Skip to content

Commit

Permalink
fix: http template host header rewrite(argoproj#12385) (argoproj#12386)
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce-Huang <44901318+Bryce-huang@users.noreply.github.com>
  • Loading branch information
Bryce-huang authored and isubasinghe committed Mar 12, 2024
1 parent 4fe8e9f commit 324f44f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion workflow/executor/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -341,7 +342,12 @@ func (ae *AgentExecutor) executeHTTPTemplateRequest(ctx context.Context, httpTem
}
value = string(secret)
}
request.Header.Add(header.Name, value)
// for rewrite host header
if strings.ToLower(header.Name) == "host" {
request.Host = value
} else {
request.Header.Add(header.Name, value)
}
}

response, err := httpClients[httpTemplate.InsecureSkipVerify].Do(request)
Expand Down

0 comments on commit 324f44f

Please sign in to comment.