@@ -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)
return nil, err