Skip to content

Commit d284fd8

Browse files
KimMachineGunelithrar
authored andcommitted
Modify 403 status code to const variable (#349)
* Modify http status code to variable * Modify doc
1 parent c0091a0 commit d284fd8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ A more complex authentication middleware, which maps session token to users, cou
287287
log.Printf("Authenticated user %s\n", user)
288288
next.ServeHTTP(w, r)
289289
} else {
290-
http.Error(w, "Forbidden", 403)
290+
http.Error(w, "Forbidden", http.StatusForbidden)
291291
}
292292
})
293293
}

example_authentication_middleware_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler
3030
log.Printf("Authenticated user %s\n", user)
3131
next.ServeHTTP(w, r)
3232
} else {
33-
http.Error(w, "Forbidden", 403)
33+
http.Error(w, "Forbidden", http.StatusForbidden)
3434
}
3535
})
3636
}

0 commit comments

Comments
 (0)