mirror of
https://github.com/r-smith/deceptifeed.git
synced 2025-10-23 00:12:22 +00:00
feat: add fixed delay to basic auth
This commit is contained in:
@@ -219,6 +219,9 @@ func handleConnection(cfg *config.Server, customHeaders map[string]string, respo
|
||||
case modeDefault:
|
||||
// Built-in default response.
|
||||
if r.URL.Path == "/" || r.URL.Path == "/index.html" {
|
||||
if _, _, ok := r.BasicAuth(); ok {
|
||||
time.Sleep(2 * time.Second)
|
||||
}
|
||||
w.Header()["WWW-Authenticate"] = []string{"Basic"}
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user