Skip to content

Commit 9aafbbb

Browse files
committed
Fixed issue preventing catalogue from being updated due to http cache.
1 parent 18ec2d0 commit 9aafbbb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

camel_tools/data/downloader.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import zipfile
3333

3434
import requests
35+
from requests.structures import CaseInsensitiveDict
3536

3637

3738
_STREAM_CHUNK_SIZE = 32768
@@ -111,7 +112,13 @@ def _save_content(url,
111112

112113
try:
113114
session = requests.Session()
114-
response = session.get(url, stream=True)
115+
116+
headers = CaseInsensitiveDict()
117+
headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
118+
headers["Pragma"] = "no-cache"
119+
headers["Expires"] = "0"
120+
121+
response = session.get(url, stream=True, headers=headers)
115122

116123
curr_size = 0
117124
total_size = int(response.headers.get('content-length', 0))

0 commit comments

Comments
 (0)