feat: Implement connection closure handling in status 444 by HynoR · Pull Request #11574 · 1Panel-dev/1Panel

What this PR does / why we need it?

#11450

Summary of your change

ref

func CloseDirectly(c *gin.Context) {
hijacker, ok := c.Writer.(http.Hijacker)
if !ok {
c.AbortWithStatus(http.StatusForbidden)
return
}
conn, _, err := hijacker.Hijack()
if err != nil {
c.AbortWithStatus(http.StatusForbidden)
return
}

把agent 里的 CloseDirectly 改改直接搬到 core里用,我们不生产代码,我们只是代码的搬运工
截屏2026-01-06 15 32 45

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.