mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-21 16:56:27 -05:00
fix: unexpected path in httpugprade (#2773)
This commit is contained in:
parent
b6da3e86a5
commit
57d712a4d4
12
transport/internet/httpupgrade/config.go
Normal file
12
transport/internet/httpupgrade/config.go
Normal file
@ -0,0 +1,12 @@
|
||||
package httpupgrade
|
||||
|
||||
func (c *Config) GetNormalizedPath() string {
|
||||
path := c.Path
|
||||
if path == "" {
|
||||
return "/"
|
||||
}
|
||||
if path[0] != '/' {
|
||||
return "/" + path
|
||||
}
|
||||
return path
|
||||
}
|
@ -20,7 +20,7 @@ func dialhttpUpgrade(ctx context.Context, dest net.Destination, streamSettings *
|
||||
if err != nil {
|
||||
return nil, newError("failed to dial request to ", dest).Base(err)
|
||||
}
|
||||
req, err := http.NewRequest("GET", "/"+transportConfiguration.Path, nil)
|
||||
req, err := http.NewRequest("GET", transportConfiguration.GetNormalizedPath(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user