Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a host header is defined override req.Host in the metrics ui #13071

Merged
merged 2 commits into from
May 13, 2022

Conversation

dhiaayachi
Copy link
Collaborator

Description

Fix #10164
The behaviour of req.Header.Set in the go http package ignore the Header when it's named Host. To se the Host header this need to be set in req.Host.
This PR add the ability to do so for the ui internal endpoint, so users can add an add_header directive in Consul config to overwrite the Host header so a proxy can be configured.

Note:
Header names are case insensitive as defined in here

@hashicorp-ci
Copy link
Contributor

After merging, confirm that you see messages like: 🍒✅ Cherry pick of commit ... onto ... succeeded!

2 similar comments
@hashicorp-ci
Copy link
Contributor

After merging, confirm that you see messages like: 🍒✅ Cherry pick of commit ... onto ... succeeded!

@hashicorp-ci
Copy link
Contributor

After merging, confirm that you see messages like: 🍒✅ Cherry pick of commit ... onto ... succeeded!

@dhiaayachi dhiaayachi requested review from a team, kyhavlov and markan and removed request for a team May 13, 2022 13:09
Copy link
Contributor

@markan markan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: the host header is handled separately from the rest of the headers.

@dhiaayachi dhiaayachi merged commit a045577 into main May 13, 2022
@dhiaayachi dhiaayachi deleted the metrics-header-host branch May 13, 2022 18:05
@hashicorp-ci
Copy link
Contributor

After merging, confirm that you see linked PRs AND check that them for CI errors.

@hashicorp-ci
Copy link
Contributor

After merging, confirm that you see linked PRs AND check that them for CI errors.

1 similar comment
@hashicorp-ci
Copy link
Contributor

After merging, confirm that you see linked PRs AND check that them for CI errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metrics Proxy config cannot be set to correct Host header
3 participants