Merge pull request #58 from pdbrito/http-fixes

Fix check for zero value
This commit is contained in:
Chris James 2018-05-03 10:06:39 +01:00 committed by GitHub
commit f030fdb2b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -675,7 +675,7 @@ func (p *PlayerServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
score := p.store.GetPlayerScore(player)
if score == "" {
if score == 0 {
w.WriteHeader(http.StatusNotFound)
}
@ -704,7 +704,7 @@ func (p *PlayerServer) showScore(w http.ResponseWriter, r *http.Request) {
score := p.store.GetPlayerScore(player)
if score == "" {
if score == 0 {
w.WriteHeader(http.StatusNotFound)
}
@ -897,7 +897,7 @@ func (p *PlayerServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (p *PlayerServer) showScore(w http.ResponseWriter, player string) {
score := p.store.GetPlayerScore(player)
if score == "" {
if score == 0 {
w.WriteHeader(http.StatusNotFound)
}