refactor/handlers (#51)

* wip

* refactor: use prefix instead of patern in docker meta

* tests: fix tests
This commit is contained in:
Stavros
2025-03-19 15:48:16 +02:00
committed by GitHub
parent 52f189563b
commit f3471880ee
8 changed files with 811 additions and 704 deletions

View File

@@ -46,14 +46,14 @@ func ParseUsers(users string) (types.Users, error) {
return usersParsed, nil
}
// Root url parses parses a hostname and returns the root domain (e.g. sub1.sub2.domain.com -> sub2.domain.com)
func GetRootURL(urlSrc string) (string, error) {
// Get upper domain parses a hostname and returns the upper domain (e.g. sub1.sub2.domain.com -> sub2.domain.com)
func GetUpperDomain(urlSrc string) (string, error) {
// Make sure the url is valid
urlParsed, parseErr := url.Parse(urlSrc)
urlParsed, err := url.Parse(urlSrc)
// Check if there was an error
if parseErr != nil {
return "", parseErr
if err != nil {
return "", err
}
// Split the hostname by period