fix(server): ensure HTTP handler is set only if initialized

This commit is contained in:
yusing 2025-04-17 14:49:04 +08:00
parent 0a13bcb8a3
commit 9d85a41bc5

View file

@ -96,7 +96,9 @@ func (s *Server) Start(parent task.Parent) {
TLSConfig: http3.ConfigureTLSConfig(s.https.TLSConfig),
}
Start(subtask, h3, &s.l)
s.http.Handler = advertiseHTTP3(s.http.Handler, h3)
if s.http != nil {
s.http.Handler = advertiseHTTP3(s.http.Handler, h3)
}
s.https.Handler = advertiseHTTP3(s.https.Handler, h3)
}