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

pkg/logging: Fix HTTP logging middleware panic #3922

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

brancz
Copy link
Member

@brancz brancz commented Mar 12, 2021

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Use net.SplitHostPort instead of strings.Split with a direct slice access, which caused panics when the Host header is not available or doesn't contain a port.

Verification

Added a unit test that without this patch paniced.

Fixes #3921

@thanos-io/thanos-maintainers

@brancz brancz force-pushed the fix-http-log-panic branch 3 times, most recently from e773949 to 42e4dab Compare March 12, 2021 10:42
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
@yashrsharma44
Copy link
Contributor

Looks great to me 💯

@metalmatze
Copy link
Contributor

Enabling auto-merge when CI goes green :)

@metalmatze metalmatze enabled auto-merge (squash) March 12, 2021 11:03
@metalmatze metalmatze merged commit fc9e30e into thanos-io:main Mar 12, 2021
@brancz brancz deleted the fix-http-log-panic branch March 12, 2021 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic in logging http middleware
3 participants