Rate limit login stuff
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func (s *Server) usersLog(w http.ResponseWriter, r *http.Request) {
|
||||
s.limiter.Wait(r.Context())
|
||||
q := r.URL.Query()
|
||||
fmt.Fprintln(w, `
|
||||
<html>
|
||||
@@ -27,6 +28,7 @@ func (s *Server) usersLog(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) usersRegister(w http.ResponseWriter, r *http.Request) {
|
||||
s.limiter.Wait(r.Context())
|
||||
fmt.Fprintln(w, `
|
||||
<html>
|
||||
<body>
|
||||
@@ -40,6 +42,7 @@ func (s *Server) usersRegister(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) usersSubmit(w http.ResponseWriter, r *http.Request) {
|
||||
s.limiter.Wait(r.Context())
|
||||
if r.Method != "POST" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user