1
0
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:
ghosx 2023-11-24 08:51:49 +08:00 committed by GitHub
parent b6da3e86a5
commit 57d712a4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View 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
}

View File

@ -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
}