mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Properly parse HTTP host for verification
Also fix H2 transport to not verify if host is not defined
This commit is contained in:
@ -39,7 +39,7 @@ func (s *server) Handle(conn net.Conn) (stat.Connection, error) {
|
||||
|
||||
if s.config != nil {
|
||||
host := req.Host
|
||||
if len(s.config.Host) > 0 && !strings.Contains(strings.ToLower(host), strings.ToLower(s.config.Host)) {
|
||||
if len(s.config.Host) > 0 && !internet.IsValidHTTPHost(host, s.config.Host) {
|
||||
return nil, errors.New("bad host: ", host)
|
||||
}
|
||||
path := s.config.GetNormalizedPath()
|
||||
|
Reference in New Issue
Block a user