mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-21 07:26:52 +00:00
parser: Fix nil match panic in v2rayTransportWsPath
This commit is contained in:
@@ -27,6 +27,10 @@ func shadowsocksPluginOptions(plugin string) string {
|
||||
func v2rayTransportWsPath(WebsocketOptions *option.V2RayWebsocketOptions, path string) {
|
||||
reg := regexp.MustCompile(`^(.*?)(?:\?ed=(\d*))?$`)
|
||||
result := reg.FindStringSubmatch(path)
|
||||
if result == nil {
|
||||
WebsocketOptions.Path = path
|
||||
return
|
||||
}
|
||||
WebsocketOptions.Path = result[1]
|
||||
if result[2] != "" {
|
||||
WebsocketOptions.EarlyDataHeaderName = "Sec-WebSocket-Protocol"
|
||||
|
||||
Reference in New Issue
Block a user