diff --git a/Sources/KituraNet/HTTP/HTTPServer.swift b/Sources/KituraNet/HTTP/HTTPServer.swift index eea14f9b..4af87d51 100644 --- a/Sources/KituraNet/HTTP/HTTPServer.swift +++ b/Sources/KituraNet/HTTP/HTTPServer.swift @@ -333,7 +333,7 @@ class HTTPDummyServerDelegate: ServerDelegate { response.statusCode = .notFound let theBody = "Path not found" response.headers["Content-Type"] = ["text/plain"] - response.headers["Content-Length"] = [String(theBody.lengthOfBytes(using: .utf8))] + response.headers["Content-Length"] = [String(theBody.utf8.count)] try response.write(from: theBody) try response.end() }