fix nil ptr

This commit is contained in:
Денис Евстигнеев 2024-03-12 16:44:34 +03:00
parent c3e6cdd973
commit 5e6bd93a6b

View File

@ -562,6 +562,8 @@ func (h *Server) Start() error {
var ok bool
if hs, ok = h.opts.Context.Value(serverKey{}).(*http.Server); ok && hs != nil {
hs.Handler = fn
} else {
hs = &http.Server{Handler: fn}
}
}