소스 검색

Also log the forwarding host for forwarded requests

Unrud 9 년 전
부모
커밋
69d39b47ca
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      radicale/__init__.py

+ 2 - 1
radicale/__init__.py

@@ -313,7 +313,8 @@ class Application:
         if environ.get("REMOTE_HOST"):
             remote_host = environ["REMOTE_HOST"]
         if environ.get("HTTP_X_FORWARDED_FOR"):
-            remote_host = environ["HTTP_X_FORWARDED_FOR"]
+            remote_host = "%s (forwarded by %s)" % (
+                environ["HTTP_X_FORWARDED_FOR"], remote_host)
         remote_useragent = "UNKNOWN"
         if environ.get("HTTP_USER_AGENT"):
             remote_useragent = environ["HTTP_USER_AGENT"]