diff --git a/common/convert/converter_test.go b/common/convert/converter_test.go index bee4d5dc0..31ed168e6 100644 --- a/common/convert/converter_test.go +++ b/common/convert/converter_test.go @@ -172,9 +172,8 @@ func TestConvertsV2RayVlessHTTPTransportUsesH2Opts(t *testing.T) { assert.Len(t, proxies, 1) assert.Equal(t, "h2", proxies[0]["network"]) assert.Equal(t, map[string]any{ - "host": []string{"cdn.example.com"}, - "path": []string{"/grpc"}, - "headers": map[string]any{}, + "host": []string{"cdn.example.com"}, + "path": "/grpc", }, proxies[0]["h2-opts"]) assert.NotContains(t, proxies[0], "http-opts") } diff --git a/common/convert/v.go b/common/convert/v.go index d6603f06b..9ba6d1f47 100644 --- a/common/convert/v.go +++ b/common/convert/v.go @@ -91,16 +91,14 @@ func handleVShareLink(names map[string]int, url *url.URL, scheme string, proxy m proxy["http-opts"] = httpOpts case "h2": - headers := make(map[string]any) h2Opts := make(map[string]any) - h2Opts["path"] = []string{"/"} + h2Opts["path"] = "/" if path := query.Get("path"); path != "" { - h2Opts["path"] = []string{path} + h2Opts["path"] = path } if host := query.Get("host"); host != "" { h2Opts["host"] = []string{host} } - h2Opts["headers"] = headers proxy["h2-opts"] = h2Opts case "ws", "httpupgrade":