Make CGI do errors better

This commit is contained in:
Neale Pickett 2015-02-23 02:44:09 +00:00
parent 3afbec6ef3
commit d0f68c5d1a
1 changed files with 3 additions and 0 deletions

View File

@ -161,6 +161,9 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} }
func main() { func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
log.SetPrefix("Status: 500 CGI Go Boom\nContent-type: text/plain\n\nERROR: ")
h := Handler{} h := Handler{}
if err := cgi.Serve(h); err != nil { if err := cgi.Serve(h); err != nil {
log.Fatal(err) log.Fatal(err)