summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/caddyauth/caddyfile.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2020-06-01 23:56:47 -0600
committerGitHub <noreply@github.com>2020-06-01 23:56:47 -0600
commit9a7756c6e4b4ddb945bede3ddb2dfbf241208915 (patch)
treec13b241c6caefff0fce9b08084ae63b013f345a0 /modules/caddyhttp/caddyauth/caddyfile.go
parentfdf2a77feb53cb9dd6de772f811e96a5f6b2d2c4 (diff)
caddyauth: Cache basicauth results (fixes #3462) (#3465)
Cache capacity is currently hard-coded at 1000 with random eviction. It is enabled by default from Caddyfile configurations because I assume this is the most common preference.
Diffstat (limited to 'modules/caddyhttp/caddyauth/caddyfile.go')
-rw-r--r--modules/caddyhttp/caddyauth/caddyfile.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/caddyhttp/caddyauth/caddyfile.go b/modules/caddyhttp/caddyauth/caddyfile.go
index 9fe8a80..13e78fc 100644
--- a/modules/caddyhttp/caddyauth/caddyfile.go
+++ b/modules/caddyhttp/caddyauth/caddyfile.go
@@ -35,6 +35,7 @@ func init() {
// If no hash algorithm is supplied, bcrypt will be assumed.
func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) {
var ba HTTPBasicAuth
+ ba.HashCache = new(Cache)
for h.Next() {
var cmp Comparer