MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / CloseDirectly

Function CloseDirectly

core/utils/security/security.go:219–233  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

217}
218
219func CloseDirectly(c *gin.Context) {
220 hijacker, ok := c.Writer.(http.Hijacker)
221 if !ok {
222 c.AbortWithStatus(http.StatusForbidden)
223 return
224 }
225 conn, _, err := hijacker.Hijack()
226 if err != nil {
227 c.AbortWithStatus(http.StatusForbidden)
228 return
229 }
230
231 conn.Close()
232 c.Abort()
233}

Callers 1

HandleNotSecurityFunction · 0.70

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected