fix: unexpected path in httpugprade (#2773)

This commit is contained in:
ghosx
2023-11-24 00:51:49 +00:00
committed by GitHub
parent b6da3e86a5
commit 57d712a4d4
2 changed files with 13 additions and 1 deletions
+12
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
}
+1 -1
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
}