Notify users if they were blocked due to proxy

This commit is contained in:
Cadence Ember
2020-07-31 03:19:55 +12:00
parent f0a28d485f
commit d4f9af44b0
3 changed files with 21 additions and 2 deletions

View File

@@ -159,7 +159,8 @@ module.exports = [
} else if (error === constants.symbols.extractor_results.AGE_RESTRICTED) {
return render(403, "pug/age_gated.pug", {settings})
} else if (error === constants.symbols.QUOTA_REACHED) {
return render(429, "pug/quota_reached.pug")
const isProxyNetwork = quota.isProxyNetwork(req)
return render(429, "pug/quota_reached.pug", {isProxyNetwork})
} else {
throw error
}
@@ -302,7 +303,8 @@ module.exports = [
} else if (error === constants.symbols.RATE_LIMITED) {
return render(503, "pug/blocked_graphql.pug")
} else if (error === constants.symbols.QUOTA_REACHED) {
return render(429, "pug/quota_reached.pug")
const isProxyNetwork = quota.isProxyNetwork(req)
return render(429, "pug/quota_reached.pug", {isProxyNetwork})
} else {
throw error
}