mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-07 08:07:20 +02:00
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)
This commit is contained in:
parent
a18413dd03
commit
bb9deccff6
@ -475,9 +475,11 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) {
|
|||||||
utils.SendErrorResponse(w, "invalid rate limit number")
|
utils.SendErrorResponse(w, "invalid rate limit number")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if proxyRateLimit <= 0 {
|
if requireRateLimit && proxyRateLimit <= 0 {
|
||||||
utils.SendErrorResponse(w, "rate limit number must be greater than 0")
|
utils.SendErrorResponse(w, "rate limit number must be greater than 0")
|
||||||
return
|
return
|
||||||
|
} else if proxyRateLimit < 0 {
|
||||||
|
proxyRateLimit = 1000
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bypass WebSocket Origin Check
|
// Bypass WebSocket Origin Check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user