From 8a72ecae69ec2d40cace321fa56e92a581b88668 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 11 Jan 2015 17:40:43 -0900 Subject: [PATCH] =?UTF-8?q?Oops=20=E2=80=94=20don=E2=80=99t=20worry=20abou?= =?UTF-8?q?t=20genus=20for=20non=20soubrettes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/auth.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/auth.go b/api/auth.go index 43b43a1..baf647d 100644 --- a/api/auth.go +++ b/api/auth.go @@ -104,7 +104,9 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { writeJSON(w, Error{errGenericError}) return } - if mux.Vars(r)["genus"] != token.Claims["genus"] { + genus := mux.Vars(r)["genus"] + // We don't care about this if we aren't accessing one of the subrouter routes. + if genus != "" && genus != token.Claims["genus"] { w.WriteHeader(http.StatusInternalServerError) writeJSON(w, Error{errAccessDenied}) return