mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 12:42:27 +08:00
fixed: invalid argument to Intn (#1133)
This commit is contained in:
parent
288899a473
commit
0b4662e4b7
@ -3,6 +3,7 @@ package vmess
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -54,6 +55,10 @@ func (hc *httpConn) Write(b []byte) (int, error) {
|
||||
return hc.Conn.Write(b)
|
||||
}
|
||||
|
||||
if len(hc.cfg.Path) == 0 {
|
||||
return -1, errors.New("path is empty")
|
||||
}
|
||||
|
||||
path := hc.cfg.Path[fastrand.Intn(len(hc.cfg.Path))]
|
||||
host := hc.cfg.Host
|
||||
if header := hc.cfg.Headers["Host"]; len(header) != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user