fix: fix --header flag in CLI (#8023)

This commit is contained in:
Dean Sheather
2023-06-14 21:52:01 +10:00
committed by GitHub
parent df842b31e8
commit 2c843f4011
5 changed files with 140 additions and 51 deletions

View File

@ -256,7 +256,8 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
var handler http.Handler
srv := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
mutex.RLock()
defer mutex.RUnlock()
handler := handler
mutex.RUnlock()
if handler != nil {
handler.ServeHTTP(w, r)
}