Skip to content

Commit d6e8fc1

Browse files
Fix query extraction logic in writer.go
Refactor query extraction to handle hash index correctly.
1 parent 81e2ac1 commit d6e8fc1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/writer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,13 @@ func isVlessReality(line string) bool {
223223
return false
224224
}
225225
qIdx := strings.Index(line, "?")
226-
hashIdx := strings.Index(line, "#")
227226
if qIdx == -1 {
228227
return false
229228
}
230-
query := line[qIdx+1 : hashIdx]
229+
query := line[qIdx+1:]
230+
if hashIdx := strings.Index(query, "#"); hashIdx != -1 {
231+
query = query[:hashIdx]
232+
}
231233
for _, part := range strings.Split(query, "&") {
232234
kv := strings.SplitN(part, "=", 2)
233235
if len(kv) == 2 && kv[0] == "security" && kv[1] == "reality" {

0 commit comments

Comments
 (0)