         do {
             if notFound {
                 response.statusCode = HTTPStatusCode.notFound
-                let message = "None of the protocols specified in the Upgrade header are registered"
-                response.headers["Content-Type"] = ["text/plain"]
-                response.headers["Content-Length"] = [String(message.characters.count)]
-                try response.write(from: message)
+                responseBody = "None of the protocols specified in the Upgrade header are registered"
             }
             else {
                 if let theProcessor = processor, let theProtocolName = protocolName {

///  - Note: There a single instance of this struct in a server.
public struct ConnectionUpgrader {
    static var instance = ConnectionUpgrader()
    
    private var registry = [String: ConnectionUpgradeFactory]()
    

                else {
                    response.statusCode = .badRequest
                }
            }
            if let theBody = responseBody {
                response.headers["Content-Type"] = ["text/plain"]
                response.headers["Content-Length"] = [String(theBody.lengthOfBytes(using: .utf8))]
                try response.write(from: theBody)
            }
            try response.end()
        }
