Merge c45d55938b09c84a6870e21eecb2b6b72e418a11 into 0f09c3a9b4626d9fe9979cf4d0521d6ae32ab646

This commit is contained in:
Anupam Mediratta 2026-10-12 00:56:23 +09:00 committed by GitHub
commit fafdb1ce09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,10 +9,16 @@ import (
"encoding/base64"
"net/http"
"strconv"
"time"
"github.com/gin-gonic/gin/internal/bytesconv"
)
// basicAuthFailureDelay is a small artificial delay applied on failed
// authentication attempts to throttle brute-force and credential-stuffing
// attacks against BasicAuth protected routes.
const basicAuthFailureDelay = 500 * time.Millisecond
// AuthUserKey is the cookie name for user credential in basic auth.
const AuthUserKey = "user"