فهرست منبع

auto update script executed

Toby Chui 1 سال پیش
والد
کامیت
409fa944ec
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      mod/sshprox/sshprox.go

+ 6 - 0
mod/sshprox/sshprox.go

@@ -74,6 +74,12 @@ func (m *Manager) HandleHttpByInstanceId(instanceId string, w http.ResponseWrite
 		return
 	}
 
+	if targetInstance.tty == nil {
+		//Server side already closed
+		http.Error(w, "Connection already closed", http.StatusInternalServerError)
+		return
+	}
+
 	r.Header.Set("X-Forwarded-Host", r.Host)
 	requestURL := r.URL.String()
 	if r.Header["Upgrade"] != nil && strings.ToLower(r.Header["Upgrade"][0]) == "websocket" {