mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-04 11:41:36 +00:00
Notify users if they were blocked due to proxy
This commit is contained in:
parent
f0a28d485f
commit
d4f9af44b0
3 changed files with 21 additions and 2 deletions
|
|
@ -38,5 +38,14 @@ function add(req, count) {
|
|||
return limiter.add(identifier, count)
|
||||
}
|
||||
|
||||
function isProxyNetwork(req) {
|
||||
if (!constants.quota.enabled) return false // no need to try to perform detection if we didn't even load the lists
|
||||
|
||||
const ip = getIPFromReq(req)
|
||||
const identifier = getIdentifier(ip)
|
||||
return identifier === "proxy"
|
||||
}
|
||||
|
||||
module.exports.remaining = remaining
|
||||
module.exports.add = add
|
||||
module.exports.isProxyNetwork = isProxyNetwork
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue