瀏覽代碼

测试输出路径2

wytfy 6 月之前
父節點
當前提交
a4a3aeeb15
共有 1 個文件被更改,包括 2 次插入2 次删除
  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
 		}