Fix: Strict mode to enforce FQDN#65
Merged
brian-brazil merged 3 commits intoNov 25, 2019
Merged
Conversation
Go docs: https://golang.org/pkg/net/url/#Parse > Trying to parse a hostname and path without a scheme is invalid but may not necessarily return an error, due to parsing ambiguities. ``` fqdnURL, err := url.Parse(*myFqdn) if err != nil { c.handleErr(request, client, err) return } ``` Example: myFqdn was set to `b607b847b180`, scheme is missing, but no error (as mentioned in the docs). We don't need to treat myFqdn as URL since it is not an URL but rather FQDN (which is schemaless)
Closed
| logger := promlog.New(&promlogConfig) | ||
| coordinator := Coordinator{logger: logger} | ||
|
|
||
| if myFqdn == nil || strings.TrimSpace(*myFqdn) == "" { |
Contributor
There was a problem hiding this comment.
Don't trim spaces, let's not 2nd guess the user. I don't think this can be nil either.
Contributor
Author
There was a problem hiding this comment.
Ok, let's totally remove this if statement then.
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Go docs:
https://golang.org/pkg/net/url/#Parse
Example:
myFqdn was set to
b607b847b180, scheme is missing, but no error (as mentioned in the docs).We don't need to treat myFqdn as URL since it is not an URL but rather FQDN (which is schemaless)
Fixes: #64