Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion endpoints/system/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def rspamdProxy(path):
if path not in conf["antispamEndpoints"]:
return jsonify(message="Endpoint not allowed"), 403
try:
res = requests.get(conf["antispamUrl"]+"/"+path, request.args, stream=True)
res = requests.get(conf["antispamUrl"]+"/"+path, params=request.args, stream=True)
except BaseException as err:
API.logger.error(type(err).__name__+": "+" - ".join(str(arg) for arg in err.args))
return jsonify(message="Failed to connect to antispam"), 503
Expand Down
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
in combination with a WSGI server using the API object as callable
"""

# If it is available, load requests_unixsocket and register it globally.
# This allows e.g. antispamUrl: http+unix://%2Frun%2Frspamd%2Fcontroller.sock
try:
import requests_unixsocket
requests_unixsocket.monkeypatch()
except Exception:
pass

if __name__ == '__main__':
import os
import sys
Expand Down