Browse Source

Modify 403 status code to const variable (#349)

* Modify http status code to variable

* Modify doc
pull/345/merge
Geon Kim 8 years ago committed by Matt Silverlock
parent
commit
d284fd8421
  1. 2
      doc.go
  2. 2
      example_authentication_middleware_test.go

2
doc.go

@ -287,7 +287,7 @@ A more complex authentication middleware, which maps session token to users, cou
log.Printf("Authenticated user %s\n", user) log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r) next.ServeHTTP(w, r)
} else { } else {
http.Error(w, "Forbidden", 403) http.Error(w, "Forbidden", http.StatusForbidden)
} }
}) })
} }

2
example_authentication_middleware_test.go

@ -30,7 +30,7 @@ func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler
log.Printf("Authenticated user %s\n", user) log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r) next.ServeHTTP(w, r)
} else { } else {
http.Error(w, "Forbidden", 403) http.Error(w, "Forbidden", http.StatusForbidden)
} }
}) })
} }

Loading…
Cancel
Save