Skip to content

Commit

Permalink
Merge pull request #8 from czerasz/patch-1
Browse files Browse the repository at this point in the history
Fix if statement in negroni_example
  • Loading branch information
tomsteele authored May 14, 2020
2 parents 3810f5f + d89d24a commit 5b00835
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ch-4/negroni_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type badAuth struct {
func (b *badAuth) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
username := r.URL.Query().Get("username")
password := r.URL.Query().Get("password")
if username != b.Username && password != b.Password {
if username != b.Username || password != b.Password {
http.Error(w, "Unauthorized", 401)
return
}
Expand Down

0 comments on commit 5b00835

Please sign in to comment.