Lowercase hostname for CORS.

This commit is contained in:
Richard Lyons 2024-07-22 15:19:03 +02:00
parent 80ee9b5e47
commit 305ebda32f

View File

@ -1015,7 +1015,7 @@ func allowedHostsMiddleware(addr net.Addr) gin.HandlerFunc {
host, _, err := net.SplitHostPort(c.Request.Host)
if err != nil {
host = c.Request.Host
host = strings.ToLower(c.Request.Host)
}
if addr, err := netip.ParseAddr(host); err == nil {