flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit e9b49da1c1c88b9ff1c0749c4b6d2a91c43607fb
parent 9685675ad5c4d7616c40228a69fe4538b001a3c3
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Thu, 14 Jan 2021 16:41:47 -0800

Force lowercase email and username

Diffstat:
Mhttp.go | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/http.go b/http.go @@ -370,7 +370,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { } } else if r.Method == "POST" { r.ParseForm() - name := r.Form.Get("username") + name := strings.ToLower(r.Form.Get("username")) password := r.Form.Get("password") row := DB.QueryRow("SELECT username, password_hash, active, admin FROM user where username = $1 OR email = $1", name) var db_password []byte @@ -451,7 +451,7 @@ func registerHandler(w http.ResponseWriter, r *http.Request) { } } else if r.Method == "POST" { r.ParseForm() - email := r.Form.Get("email") + email := strings.ToLower(r.Form.Get("email")) password := r.Form.Get("password") errors := []string{} if r.Form.Get("password") != r.Form.Get("password2") { @@ -779,7 +779,7 @@ func runHTTPServer() { // admin commands serveMux.HandleFunc(hostname+"/admin/user/", adminUserHandler) - // TODO authentication + serveMux.HandleFunc(hostname+"/webdav/", webdavHandler) wrapped := handlers.CustomLoggingHandler(log.Writer(), handlers.RecoveryHandler()(serveMux), logFormatter)