We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 688d6f9 commit a490544Copy full SHA for a490544
vdirsyncer/http.py
@@ -1,6 +1,8 @@
1
from __future__ import annotations
2
3
import logging
4
+import os
5
+import platform
6
import re
7
from abc import ABC, abstractmethod
8
from base64 import b64encode
@@ -17,6 +19,13 @@
17
19
logger = logging.getLogger(__name__)
18
20
USERAGENT = f"vdirsyncer/{__version__}"
21
22
+# 'hack' to prevent aiohttp from loading the netrc config,
23
+# but still allow it to read PROXY_* env vars.
24
+# Otherwise, if our host is defined in the netrc config,
25
+# aiohttp will overwrite our Authorization header.
26
+# https://github.com/pimutils/vdirsyncer/issues/1138
27
+os.environ["NETRC"] = "NUL" if platform.system() == "Windows" else "/dev/null"
28
+
29
30
class AuthMethod(ABC):
31
def __init__(self, username, password):
0 commit comments