ensure a response is always sent
This commit is contained in:
parent
8c1150468d
commit
8d1d686355
4 changed files with 51 additions and 25 deletions
7
main.go
7
main.go
|
|
@ -6,6 +6,13 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
func write_error(w http.ResponseWriter) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
jsonData := []byte(`{"status":"ERROR","reason":"bad request"}`)
|
||||
w.Write(jsonData)
|
||||
}
|
||||
|
||||
func main() {
|
||||
log_level := os.Getenv("LOG_LEVEL")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue