From bb9deccff67042b519a893606abff5db8b433531 Mon Sep 17 00:00:00 2001 From: kirari04 Date: Mon, 24 Jun 2024 22:59:51 +0200 Subject: [PATCH] fix: unable to edit proxy if ratelimit is not set or <= 0 this fix checks the ratelimit value only if the requireRateLimit is set to true else it will use the provided ratelimit value unless it is less or equal to 0 then it will default to 1000 (the same value as set inside the ui) --- src/reverseproxy.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/reverseproxy.go b/src/reverseproxy.go index 2292ab9..29162ab 100644 --- a/src/reverseproxy.go +++ b/src/reverseproxy.go @@ -475,9 +475,11 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) { utils.SendErrorResponse(w, "invalid rate limit number") return } - if proxyRateLimit <= 0 { + if requireRateLimit && proxyRateLimit <= 0 { utils.SendErrorResponse(w, "rate limit number must be greater than 0") return + } else if proxyRateLimit < 0 { + proxyRateLimit = 1000 } // Bypass WebSocket Origin Check