github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/transport/internet/httpupgrade/config.go (about)

     1  package httpupgrade
     2  
     3  import (
     4  	"github.com/xtls/xray-core/common"
     5  	"github.com/xtls/xray-core/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  }