1
0
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:
Shelikhoo 2025-01-12 12:44:17 +00:00
parent 928d30814f
commit b9611a384f
No known key found for this signature in database
GPG Key ID: 4C9764E9FE80A3DC

View File

@ -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