Skip to content

Commit 23e12c7

Browse files
authored
Merge pull request ceph#65470 from rhcs-dashboard/add-user-agent
monitoring: add user-agent headers to the urllib
2 parents ecc2be5 + b8fe487 commit 23e12c7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

monitoring/ceph-mixin/tests_alerts/validate_rules.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ def fetch(self, url_str: str) -> None:
8484
if url in self.cache:
8585
return self.cache[url]
8686

87-
req = urllib.request.Request(url)
87+
headers = {
88+
"User-Agent": (
89+
"Mozilla/5.0 (X11; Linux x86_64) "
90+
"AppleWebKit/537.36 (KHTML, like Gecko) "
91+
"Chrome/139.0.0.0 Safari/537.36"
92+
),
93+
}
94+
req = urllib.request.Request(url, headers=headers)
8895
try:
8996
r = urllib.request.urlopen(req)
9097
except urllib.error.HTTPError as e:

0 commit comments

Comments
 (0)