We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent facef89 commit 040f22bCopy full SHA for 040f22b
1 file changed
bin/stashcp
@@ -247,6 +247,9 @@ def get_best_stashcache():
247
# Append text before caches string
248
append_text = "api/v1.0/geo/stashcp"
249
250
+ # Headers for the HTTP request
251
+ headers = {'Cache-control': 'max-age=0', 'User-Agent': 'stashcp/4.1'}
252
+
253
# Randomize the geo ip sites
254
random.shuffle(geo_ip_sites)
255
found = False
@@ -258,8 +261,7 @@ def get_best_stashcache():
258
261
logging.debug("Querying for closest cache: %s", final_url)
259
262
try:
260
263
# Make the request
- req = urllib2.Request(final_url)
- req.add_header("Cache-control", "max-age=0")
264
+ req = urllib2.Request(final_url, headers)
265
response = urllib2.urlopen(req)
266
if response.getcode() == 200:
267
logging.debug("Got error code 200 from %s", cur_site)
0 commit comments