Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Reduced IP address check

Yevhenii K7ea33276e20f
diff --git a/src/project/project.service.ts b/src/project/project.service.ts
index 718690b68..98731db3f 100644
--- a/src/project/project.service.ts
+++ b/src/project/project.service.ts
@@ -225,10 +225,8 @@ export class ProjectService {
if (_size(_join(projectDTO.ipBlacklist, ',')) > 300) throw new UnprocessableEntityException('The list of allowed blacklisted IP addresses must be less than 300 characters.')
_map(projectDTO.ipBlacklist, ip => {
- if (!validateIP(_trim(ip))) {
- if (!IP_REGEX.test(_trim(ip))) {
- throw new ConflictException(`IP address ${ip} is not correct`)
- }
+ if (!validateIP(_trim(ip)) && !IP_REGEX.test(_trim(ip))) {
+ throw new ConflictException(`IP address ${ip} is not correct`)
}
});
}