mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 11:11:35 +00:00
Ignore trailing . in hostnames.
This means that e.g. `https://site.tld.` will be treated the same as `https://site.tld`. In DNS, the trailing empty label means "root domain" and is usually ignored when present. There are some sites with links that don't work otherwise.
This commit is contained in:
@@ -52,6 +52,7 @@ func GetHost(r *http.Request) (string, error) {
|
||||
return "", AuthError{http.StatusBadRequest,
|
||||
fmt.Sprintf("host name %q is reserved", host)}
|
||||
}
|
||||
host = strings.TrimSuffix(host, ".")
|
||||
return host, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user