nitpicks.
This commit is contained in:
parent
07db4cf999
commit
8a1403a35d
@ -1,6 +1,6 @@
|
||||
package log
|
||||
|
||||
// Logger is a loggin interface with only the essentials that a function that needs to log should care about. Compatible with standard Go logger.
|
||||
// Logger is a logging interface with only the essentials that a function that needs to log should care about. Compatible with standard Go logger.
|
||||
type Logger interface {
|
||||
Print(v ...interface{})
|
||||
Printf(format string, v ...interface{})
|
||||
|
@ -20,7 +20,7 @@ func BasicAuth(h http.Handler, htpasswd map[string]string, realm string) http.Ha
|
||||
user, pass, _ := r.BasicAuth()
|
||||
if pw, ok := htpasswd[user]; !ok || !strings.EqualFold(pass, sha1(pw)) {
|
||||
w.Header().Set("WWW-Authenticate", rlm)
|
||||
http.Error(w, "Unauthorized.", 401)
|
||||
http.Error(w, "Unauthorized", 401)
|
||||
return
|
||||
}
|
||||
h.ServeHTTP(w, r)
|
||||
|
@ -11,7 +11,7 @@ type StatusHandler int
|
||||
func (s StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
code := int(s)
|
||||
w.WriteHeader(code)
|
||||
io.WriteString(w, http.StatusText(code))
|
||||
_, _ = io.WriteString(w, http.StatusText(code))
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user