Browse Source

测试输出路径2

wytfy 5 months ago
parent
commit
a4a3aeeb15
1 changed files with 2 additions and 2 deletions
  1. 2 2
      transport/internet/websocket/hub.go

+ 2 - 2
transport/internet/websocket/hub.go

@@ -45,12 +45,12 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req
 
 	var earlyData io.Reader
 	if !h.earlyDataEnabled { // nolint: gocritic
-		if request.URL.Path != h.path {
+		if !strings.HasPrefix(request.URL.Path, h.path) {
 			writer.WriteHeader(http.StatusNotFound)
 			return
 		}
 	} else if h.earlyDataHeaderName != "" {
-		if request.URL.Path != h.path {
+		if !strings.HasPrefix(request.URL.Path, h.path) {
 			writer.WriteHeader(http.StatusNotFound)
 			return
 		}