mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-25 23:21:41 +03:00
Fixed so, if an invalid IP is configured on trusted source, it gets logged and ignored
This commit is contained in:
parent
758f409372
commit
8634ce50c6
@ -143,8 +143,11 @@ def trustedSourceRequired(view_func: typing.Callable[..., RT]) -> typing.Callabl
|
||||
"""
|
||||
Wrapped function for decorator
|
||||
"""
|
||||
try:
|
||||
if net.ipInNetwork(request.ip, GlobalConfig.TRUSTED_SOURCES.get(True)) is False:
|
||||
return HttpResponseForbidden()
|
||||
except Exception as e:
|
||||
logger.warning('Error checking trusted source: "%s" does not seems to be a valid network string. Using Unrestricted access.', GlobalConfig.TRUSTED_SOURCES.get())
|
||||
return view_func(request, *args, **kwargs)
|
||||
|
||||
return _wrapped_view
|
||||
|
Loading…
Reference in New Issue
Block a user