Fix race in ExportStatusWriter

This commit is contained in:
Matt Joiner 2024-01-19 16:35:36 +11:00
parent 192f4e8f7e
commit 3cc8774eb3
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
1 changed files with 2 additions and 0 deletions

View File

@ -40,7 +40,9 @@ func ExportStatusWriter(sw StatusWriter, path string, t testing.TB) (release fun
http.HandleFunc(
pattern,
func(w http.ResponseWriter, r *http.Request) {
mu.Lock()
sw := sws[pattern]
mu.Unlock()
if sw == nil {
http.NotFound(w, r)
return