Inital commit

This commit is contained in:
2026-02-15 15:22:10 +01:00
commit 795c7eccb8
4 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
package response_helper
import (
"fmt"
"net"
"net/http"
)
func RespondWithStatusCode(statusCode int, conn net.Conn) {
conn.Write([]byte(fmt.Sprintf("HTTP/1.1 %d %s\r\n", statusCode, http.StatusText(statusCode))))
conn.Write([]byte("Content-Type: text/plain\r\n"))
conn.Write([]byte("Content-Length: 0\r\n"))
conn.Write([]byte("\r\n"))
}