if w.conn.hijacked() { if lenData > 0 { caller := relevantCaller() w.conn.server.logf("http: response.Write on hijacked connection from %s (%s:%d)", caller.Function, path.Base(caller.File), caller.Line) } return 0, ErrHijacked }
Here, write to respone, then get ErrHijacked. So, gin panic, how to handle it ?
Comment From: liuliqiang
Hi @smallfish-root ,
I think the reason why raise this error is that you have Hijkacked the response writer in your code, and after you hijack the connection, you can't use gin's Writerxxx
functions to write the response.
Comment From: Cookiery
Please show code that can reproduce the issue