From 345de824ef7e06afc500c5c7359819a2b819eb1f Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Thu, 19 Nov 2026 22:29:51 +0000 Subject: [PATCH] config: env.disposition takes its default as a Disposition env.disposition took its default as a string, and the call passed the literal "allow", so the default was the one disposition parameter still untyped. It now takes a wafprotocol.Disposition, as bytesCounted, coreRuleSetMode and lookupSource take their types, and the call passes wafprotocol.DispositionAllow. Model: opus-5-5 --- internal/config/rproxy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/config/rproxy.go b/internal/config/rproxy.go index 0d5223a..9655514 100644 --- a/internal/config/rproxy.go +++ b/internal/config/rproxy.go @@ -96,7 +96,7 @@ func RProxyFromEnvironment(v *viper.Viper) (*RProxy, error) { ), WAFBackendNoAnswerDisposition: env.disposition( "SWW_RPROXY_WAF_BACKEND_NO_ANSWER_DISPOSITION", - "allow", + wafprotocol.DispositionAllow, ), MaxRequestSize: env.size("SWW_RPROXY_MAX_REQUEST_SIZE", "100M"), MaxResponseSize: env.size("SWW_RPROXY_MAX_RESPONSE_SIZE", "1G"), @@ -169,9 +169,9 @@ func (e *environment) wafBackend(name string) *url.URL { // cannot be connected to, does not answer at all, or does not answer in time: // allow or deny. func (e *environment) disposition( - name, defaultValue string, + name string, defaultValue wafprotocol.Disposition, ) wafprotocol.Disposition { - value := wafprotocol.Disposition(e.value(name, defaultValue)) + value := wafprotocol.Disposition(e.value(name, string(defaultValue))) if value != wafprotocol.DispositionAllow && value != wafprotocol.DispositionDeny { e.check(name, fmt.Errorf("%q %w", value, errNotDisposition))