(c *gin.Context)
| 217 | } |
| 218 | |
| 219 | func 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 | } |
no test coverage detected