github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/transport/internet/httpupgrade/config.go (about) 1 package httpupgrade 2 3 import ( 4 "github.com/xmplusdev/xmcore/common" 5 "github.com/xmplusdev/xmcore/transport/internet" 6 ) 7 8 func (c *Config) GetNormalizedPath() string { 9 path := c.Path 10 if path == "" { 11 return "/" 12 } 13 if path[0] != '/' { 14 return "/" + path 15 } 16 return path 17 } 18 19 func init() { 20 common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} { 21 return new(Config) 22 })) 23 }