         }
 
         if  let data = buffer.data {
-            let content = writtenDataFilter(body: data)
+            let content = lifecycle.writtenDataFilter(body: data)
             let contentLength = headers["Content-Length"]
             if  contentLength == nil {
                 headers["Content-Length"] = String(content.length)

    @discardableResult
    public func end() throws {

        onEndInvoked()

        // Sets status code if unset
        if statusCode == .unknown {

    ///
    var state = State()

    private var lifecycle = Lifecycle()

    ///
    /// Set of cookies to return with the response
