mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 05:16:47 +00:00
chore: change http method from GET to POST in listener test
This commit is contained in:
1 parent
578b88190a
commit
dc5c2ecc00
1 file changed
+2
-2
@@ -175,7 +175,7 @@ func NewHttpTestTunnel() *TestTunnel {
|
||||
ln := &TestTunnelListener{ch: make(chan net.Conn), ctx: ctx, cancel: cancel, addr: net.TCPAddrFromAddrPort(netip.AddrPortFrom(remoteAddr, 0))}
|
||||
|
||||
r := chi.NewRouter()
|
||||
r.Get(httpPath, func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Post(httpPath, func(w http.ResponseWriter, r *http.Request) {
|
||||
query := r.URL.Query()
|
||||
size, err := strconv.Atoi(query.Get("size"))
|
||||
if err != nil {
|
||||
@@ -191,7 +191,7 @@ func NewHttpTestTunnel() *TestTunnel {
|
||||
//_ = http.Http2ConfigureServer(&server, h2Server)
|
||||
go server.Serve(ln)
|
||||
testFn := func(t *testing.T, proxy C.ProxyAdapter, proto string, size int) {
|
||||
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s://%s%s?size=%d", proto, remoteAddr, httpPath, size), bytes.NewReader(httpData[:size]))
|
||||
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s://%s%s?size=%d", proto, remoteAddr, httpPath, size), bytes.NewReader(httpData[:size]))
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user