fix(core): correctness and robustness fixes across all subsystems
- Move status page template to package-level template.Must (panic on parse error at init instead of nil deref at runtime) - Fix XSS in import error responses (log detail server-side, return generic message to client) - Handle ListenAndServe errors in HTTP and SSH servers - Use defer resp.Body.Close() in all alert providers, check json.Marshal errors - Share HTTP clients across checks instead of creating per-request - Use http.NewRequestWithContext for per-site timeout control - Support HTTP method field (was always GET despite DB storing method) - Implement AcceptedCodes validation (was hardcoded >= 400 despite DB storing accepted code ranges) - Add defer tx.Rollback() to ImportData for transaction safety
This commit is contained in:
@@ -161,7 +161,11 @@ func startSSHServer(port int) {
|
||||
fmt.Printf("SSH server error: %v\n", err)
|
||||
return
|
||||
}
|
||||
go func() { s.ListenAndServe() }()
|
||||
go func() {
|
||||
if err := s.ListenAndServe(); err != nil {
|
||||
log.Fatalf("SSH server failed: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func seedDemoData(s store.Store) {
|
||||
|
||||
Reference in New Issue
Block a user