Use case insensitive comparison when matching vhost

This commit is contained in:
Trevor Slocum 2020-11-25 21:43:50 -08:00
parent c64a59c44e
commit f91f42464d
2 changed files with 6 additions and 0 deletions

View File

@ -152,6 +152,8 @@ func readconfig(configPath string) error {
config.fcgiPools = make(map[string]gofast.ConnFactory)
for hostname, host := range config.Hosts {
hostname = strings.ToLower(hostname)
if defaultHost != nil {
if host.Cert == "" {
host.Cert = defaultHost.Cert

View File

@ -389,6 +389,10 @@ func handleConn(c *tls.Conn) {
return
}
if request.Scheme == "gemini" {
request.Host = strings.ToLower(request.Host)
}
status, size, logPath = handleRequest(c, request, requestData)
}