Inital commit
This commit is contained in:
14
response_helper/response_helper.go
Normal file
14
response_helper/response_helper.go
Normal 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"))
|
||||
}
|
||||
Reference in New Issue
Block a user