From 466985403932f9ea965ff8f6f7f2d9678d430d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 8 Dec 2023 21:12:43 +0800 Subject: [PATCH] Fix method check for v2ray HTTP transport --- transport/v2rayhttp/server.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/transport/v2rayhttp/server.go b/transport/v2rayhttp/server.go index ef5fffcd..cad7d906 100644 --- a/transport/v2rayhttp/server.go +++ b/transport/v2rayhttp/server.go @@ -53,9 +53,6 @@ func NewServer(ctx context.Context, options option.V2RayHTTPOptions, tlsConfig t method: options.Method, headers: options.Headers.Build(), } - if server.method == "" { - server.method = "PUT" - } if !strings.HasPrefix(server.path, "/") { server.path = "/" + server.path } @@ -85,7 +82,7 @@ func (s *Server) ServeHTTP(writer http.ResponseWriter, request *http.Request) { s.invalidRequest(writer, request, http.StatusNotFound, E.New("bad path: ", request.URL.Path)) return } - if request.Method != s.method { + if s.method != "" && request.Method != s.method { s.invalidRequest(writer, request, http.StatusNotFound, E.New("bad method: ", request.Method)) return }