Skip to content
Snippets Groups Projects
Commit e4f9ff78 authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

pass config info

parent 687083f4
No related branches found
No related tags found
No related merge requests found
Pipeline #12278 passed
......@@ -2,6 +2,7 @@ import clamd
from io import BytesIO
from django.http import HttpResponseForbidden
from django.conf import settings
class ClamAVMiddleware:
def __init__(self, get_response):
......@@ -12,7 +13,11 @@ class ClamAVMiddleware:
# Code to be executed for each request before
# the view (and later middleware) are called.
cd = clamd.ClamdNetworkSocket()
cd = clamd.ClamdNetworkSocket(
host=settings.CLAMD_TCP_ADDR,
port=settings.CLAMD_TCP_SOCKET,
timeout=120
)
if request.method == "POST" and len(request.FILES) > 0:
for file_ in request.FILES.values():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment