mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-05-18 13:09:04 -04:00
avoid panic when serving user request
This commit is contained in:
parent
928d30814f
commit
b9611a384f
@ -39,6 +39,11 @@ type WebCommander struct {
|
||||
}
|
||||
|
||||
func (w *WebCommander) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
|
||||
defer func() {
|
||||
if x := recover(); x != nil {
|
||||
newError("panic in WebCommander:", x).WriteToLog()
|
||||
}
|
||||
}()
|
||||
if w.wrappedGrpc.IsGrpcWebRequest(request) {
|
||||
w.wrappedGrpc.ServeHTTP(writer, request)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user