mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-03 22:45:01 +00:00
Accept wider range of IP for proxies and RTC relay
This commit is contained in:
@ -15,6 +15,7 @@ use crate::data::error::{Res, ResultBoxError};
|
||||
use crate::data::user_token::UserAccessToken;
|
||||
use crate::helpers::{account_helper, admin_access_token_helper, api_helper};
|
||||
use crate::routes::RequestResult;
|
||||
use crate::utils::network_utils::match_ip;
|
||||
|
||||
/// Http request handler
|
||||
///
|
||||
@ -183,7 +184,7 @@ impl BaseRequestHandler for HttpRequestHandler {
|
||||
|
||||
// We check if the request comes from a trusted reverse proxy
|
||||
if let Some(proxy) = conf().proxy.as_ref() {
|
||||
if ip.eq(proxy) {
|
||||
if match_ip(proxy, &ip) {
|
||||
if let Some(header) = self.request.headers().get("X-Forwarded-For") {
|
||||
let header: Vec<String> = header
|
||||
.to_str()
|
||||
|
Reference in New Issue
Block a user