Skip to content

Commit

Permalink
fix: correct type for vmess.ws-opts.path in ConvertsV2Ray (#1145)
Browse files Browse the repository at this point in the history
It should be a string for the following reasons:
1. During conversion, it is conditionally assigned with
   `wsOpts["path"] = path.(string)`
2. After conversion, it is decoded into `WSOptions.Path` in
   `adapter/outbound/vmess.go` which requires a string.
  • Loading branch information
Xiami2012 authored May 21, 2024
1 parent ac25061 commit 5eb8958
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/convert/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) {
case "ws", "httpupgrade":
headers := make(map[string]any)
wsOpts := make(map[string]any)
wsOpts["path"] = []string{"/"}
wsOpts["path"] = "/"
if host, ok := values["host"]; ok && host != "" {
headers["Host"] = host.(string)
}
Expand Down

0 comments on commit 5eb8958

Please sign in to comment.