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

fix: config file CLI argument for relative paths -> v0.23.1 #1265

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

DiniFarb
Copy link
Contributor

Fix for #1263, there was an unnecessary check with url.ParseRequestURI. If you throw in gibberish it'll fail anyways.

Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
@DiniFarb DiniFarb requested a review from a team as a code owner July 31, 2023 16:31
config/config.go Outdated
}
if url.Scheme == "http" || url.Scheme == "https" {
var err error
if strings.HasPrefix(file, "http") || strings.HasPrefix(file, "https") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth including the :// part of the URL in the prefix check, on the off chance a user has a config file named http_something.yml?

I.E. strings.HasPrefix(file, "http://")

@breed808 breed808 linked an issue Aug 1, 2023 that may be closed by this pull request
Signed-off-by: Dinifarb <andreas.vogt89@bluewin.ch>
Copy link
Contributor

@breed808 breed808 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for submitting this!

@breed808 breed808 merged commit b0a1a38 into prometheus-community:master Aug 1, 2023
5 checks passed
@DiniFarb DiniFarb deleted the fix_configfile branch August 21, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants