     func withHeader(_ key: String, _ value: String?) -> Self
         {
         synchronized
-            { stub.requestHeaders[key] = value }
+            { stub.matcher.headers[key] = value }
         return self
         }
 

                { Self.requestInitialization.decrement() }

            let stubs = Self.stubs
            guard let stub = stubs.first(where: { $0.matches(request) }) else
                {
                fatalError(
                    """


    let delayLatch = Latch(name: "delayed request")

    var description: String
        { "\(matcher) → \(responseCode)" }
    }

@discardableResult
func stubRequest(_ resource: () -> Resource, _ method: String) -> LSStubRequestDSL
    {
    let stub = RequestStub(matcher: RequestMatcher(method: method, url: resource().url.absoluteString))
    NetworkStub.add(stub)
    return LSStubRequestDSL(stub: stub)
    }
