add: use RemoteAddr for ip blocks as well

This commit is contained in:
trisua 2025-06-30 15:35:18 -04:00
parent 14936b8b90
commit f5faed7762
12 changed files with 127 additions and 28 deletions

View file

@ -67,7 +67,7 @@ pub async fn create_request(
// check for ip ban
if data
.get_ipban_by_addr(RemoteAddr::from(real_ip.as_str()))
.get_ipban_by_addr(&RemoteAddr::from(real_ip.as_str()))
.await
.is_ok()
{

View file

@ -43,7 +43,7 @@ pub async fn create_request(
// check for ip ban
if data
.get_ipban_by_addr(RemoteAddr::from(real_ip.as_str()))
.get_ipban_by_addr(&RemoteAddr::from(real_ip.as_str()))
.await
.is_ok()
{
@ -145,7 +145,7 @@ pub async fn ip_block_request(
// check for an existing ip block
if data
.get_ipblock_by_initiator_receiver(user.id, &question.ip)
.get_ipblock_by_initiator_receiver(user.id, &RemoteAddr::from(question.ip.as_str()))
.await
.is_ok()
{