Adding .gitignore and fixes (return) for logic.
parent
6890c87586
commit
b8eaa40100
|
@ -0,0 +1,2 @@
|
||||||
|
.idea
|
||||||
|
*.iml
|
|
@ -26,6 +26,7 @@ func handleIndex(writer http.ResponseWriter, _ *http.Request) {
|
||||||
writer.WriteHeader(500)
|
writer.WriteHeader(500)
|
||||||
_, _ = writer.Write([]byte("Internal server error"))
|
_, _ = writer.Write([]byte("Internal server error"))
|
||||||
_, _ = fmt.Fprintf(os.Stderr, "Internal server error while marshalling response")
|
_, _ = fmt.Fprintf(os.Stderr, "Internal server error while marshalling response")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.Header().Set("Content-Type", "application/json")
|
writer.Header().Set("Content-Type", "application/json")
|
||||||
|
@ -51,6 +52,7 @@ func handleInfo(writer http.ResponseWriter, _ *http.Request) {
|
||||||
writer.WriteHeader(500)
|
writer.WriteHeader(500)
|
||||||
_, _ = writer.Write([]byte("Internal server error"))
|
_, _ = writer.Write([]byte("Internal server error"))
|
||||||
_, _ = fmt.Fprintf(os.Stderr, "Internal server error while marshalling response")
|
_, _ = fmt.Fprintf(os.Stderr, "Internal server error while marshalling response")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.Header().Set("Content-Type", "application/json")
|
writer.Header().Set("Content-Type", "application/json")
|
||||||
|
@ -77,6 +79,7 @@ func handleDefault(writer http.ResponseWriter, _ *http.Request) {
|
||||||
writer.WriteHeader(500)
|
writer.WriteHeader(500)
|
||||||
_, _ = writer.Write([]byte("Internal server error"))
|
_, _ = writer.Write([]byte("Internal server error"))
|
||||||
_, _ = fmt.Fprintf(os.Stderr, "Internal server error while marshalling response")
|
_, _ = fmt.Fprintf(os.Stderr, "Internal server error while marshalling response")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.Header().Set("Content-Type", "application/json")
|
writer.Header().Set("Content-Type", "application/json")
|
||||||
|
|
Loading…
Reference in New Issue