Browse Source

feature: v4.45.2版本改造

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

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

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