Skip to content

Commit

Permalink
Modify 403 status code to const variable (#349)
Browse files Browse the repository at this point in the history
* Modify http status code to variable

* Modify doc
  • Loading branch information
KimMachineGun authored and elithrar committed Feb 25, 2018
1 parent c0091a0 commit d284fd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ A more complex authentication middleware, which maps session token to users, cou
log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r)
} else {
http.Error(w, "Forbidden", 403)
http.Error(w, "Forbidden", http.StatusForbidden)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion example_authentication_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler
log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r)
} else {
http.Error(w, "Forbidden", 403)
http.Error(w, "Forbidden", http.StatusForbidden)
}
})
}
Expand Down

0 comments on commit d284fd8

Please sign in to comment.