diff options
Diffstat (limited to 'internal/middleware')
| -rw-r--r-- | internal/middleware/nollamas.go | 4 | ||||
| -rw-r--r-- | internal/middleware/nollamas_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/internal/middleware/nollamas.go b/internal/middleware/nollamas.go index eedf3b9b7..914469a24 100644 --- a/internal/middleware/nollamas.go +++ b/internal/middleware/nollamas.go @@ -55,7 +55,7 @@ func NoLLaMas( getInstanceV1 func(context.Context) (*apimodel.InstanceV1, gtserror.WithCode), ) gin.HandlerFunc { - if !config.GetAdvancedScraperDeterrence() { + if !config.GetAdvancedScraperDeterrenceEnabled() { // NoLLaMas middleware disabled. return func(*gin.Context) {} } @@ -72,7 +72,7 @@ func NoLLaMas( var nollamas nollamas nollamas.seed = seed nollamas.ttl = time.Hour - nollamas.diff = 4 + nollamas.diff = config.GetAdvancedScraperDeterrenceDifficulty() nollamas.getInstanceV1 = getInstanceV1 nollamas.policy = cookiePolicy return nollamas.Serve diff --git a/internal/middleware/nollamas_test.go b/internal/middleware/nollamas_test.go index 37b66e5e9..ffe8cbbc8 100644 --- a/internal/middleware/nollamas_test.go +++ b/internal/middleware/nollamas_test.go @@ -45,7 +45,7 @@ func TestNoLLaMasMiddleware(t *testing.T) { e := gin.New() // Setup necessary configuration variables. - config.SetAdvancedScraperDeterrence(true) + config.SetAdvancedScraperDeterrenceEnabled(true) config.SetWebTemplateBaseDir("../../web/template") // Load templates into engine. |
