From 1af3724981a88128d7dd4ee28f4ec0a274e6126d Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 28 Mar 2024 18:03:07 +0100 Subject: [PATCH] Removed fmt package --- Server.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Server.go b/Server.go index 8f35347..f987c51 100644 --- a/Server.go +++ b/Server.go @@ -3,7 +3,6 @@ package web import ( "bufio" "bytes" - "fmt" "io" "log" "net" @@ -140,14 +139,14 @@ func (s *server) handleConnection(conn net.Conn) { space := strings.IndexByte(message, ' ') if space <= 0 { - fmt.Fprint(conn, "HTTP/1.1 400 Bad Request\r\n\r\n") + io.WriteString(conn, "HTTP/1.1 400 Bad Request\r\n\r\n") return } method = message[:space] if !isRequestMethod(method) { - fmt.Fprint(conn, "HTTP/1.1 400 Bad Request\r\n\r\n") + io.WriteString(conn, "HTTP/1.1 400 Bad Request\r\n\r\n") return }