commit 427ab4266e58658b765a3246a7b2c6bea291ca1f
parent d2dd68dbeff61fc338b735da023aac45b2511724
Author: MTRNord <mtrnord1@gmail.com>
Date: Mon, 2 Apr 2018 19:56:20 +0200
Fix multiple header that get written
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/api/login/twitter.go b/api/login/twitter.go
@@ -181,8 +181,9 @@ func IsAuthenticated(req *http.Request) bool {
func IsAuthenticatedHandleFunc(w http.ResponseWriter, req *http.Request) {
if IsAuthenticated(req) {
w.WriteHeader(http.StatusOK)
+ } else {
+ w.WriteHeader(http.StatusUnauthorized)
}
- w.WriteHeader(http.StatusUnauthorized)
}
// LoginHandler handles Twitter login requests by obtaining a request token and