-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default domain name mechanism (#95)
- implement inserting default domain name to the hostname if it does not contain a domain name - fix a bug with the positive validation of not whitelisted domain when it contains a whitelisted domain - bump builder image version to be the same as used in CI job (1.13.4)
- Loading branch information
Showing
12 changed files
with
305 additions
and
90 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package helpers | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
func GetHostWithDomain(host, defaultDomainName string) string { | ||
if !HostIncludesDomain(host) { | ||
return GetHostWithDefaultDomain(host, defaultDomainName) | ||
} | ||
return host | ||
} | ||
|
||
func HostIncludesDomain(host string) bool { | ||
return strings.Contains(host, ".") | ||
} | ||
|
||
func GetHostWithDefaultDomain(host, defaultDomainName string) string { | ||
return fmt.Sprintf("%s.%s", host, defaultDomainName) | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.