argoproj / argoproj/argo-workflows

CLI: Promote "Host" header to `Request.Host`

Open
#12,690 0 comments 3 reactions 0 assignees View on GitHub
area/cli
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

The Go HTTP client ignores `Host` header values.

To override the request `Host` header, you must set the [Request](https://golang.org/pkg/net/http/#Request) `Host` field.

## Use Cases

When communicating with a proxy or load balancer that does not do Host header rewriting, it may be required to override the default request `Host` header.

Go's HTTP request does not do this by default when passed a `Host` header value.

See https://github.com/golang/go/issues/29865

---

This is a super simple change and I'll raise a PR.

**Message from the maintainers**:

Love this enhancement proposal? Give it a 👍. We prioritize the proposals with the most 👍.

Contributor guide

Open the contributing guide

Research direction

Trace the Go CLI's HTTP request construction and inspect how Host headers are handled, then find the existing request tests. Confirm the desired behavior against Go's Request.Host documentation and the linked issue. Done means a supplied Host header is promoted to Request.Host and the behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.