Skip to content

Commit

Permalink
feat(parser): support more extended delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
antegral authored Aug 14, 2024
1 parent 8aba00d commit d98b381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netfunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func parseTicketStr(body string) (Ticket, error) {

// parsing NetFunnel.gControl.result
// example: <int>:<int>:ip=nf.example.com&key=<string>&nnext=<int>&nwait=<int>&port=<int>&tps=<int>&ttl=<int>
val, err := url.ParseQuery(strings.SplitN(id, ":", 2)[2]) // we need only "ip=nf.example.com&key=<string>&nnext=<int>&nwait=<int>&port=<int>&tps=<int>&ttl=<int>"
val, err := url.ParseQuery(strings.SplitN(id, ":", -1)[2]) // we need only "ip=nf.example.com&key=<string>&nnext=<int>&nwait=<int>&port=<int>&tps=<int>&ttl=<int>"
if err != nil {
return Ticket{}, fmt.Errorf("failed to parse response body (url.ParseQuery failed): %s", err)
}
Expand Down

0 comments on commit d98b381

Please sign in to comment.