crowdsec_range_bouncer: User-Agent carries a version, the LAPI warned about a bad user agent on every pull
This commit is contained in:
@@ -28,7 +28,7 @@ def fetch_ranges(lapi_url, api_key):
|
|||||||
"""Return the networks of all ban decisions with scope Range."""
|
"""Return the networks of all ban decisions with scope Range."""
|
||||||
request = urllib.request.Request(
|
request = urllib.request.Request(
|
||||||
lapi_url.rstrip("/") + "/v1/decisions?scopes=range",
|
lapi_url.rstrip("/") + "/v1/decisions?scopes=range",
|
||||||
headers={"X-Api-Key": api_key, "User-Agent": "crowdsec-range-bouncer"},
|
headers={"X-Api-Key": api_key, "User-Agent": "crowdsec-range-bouncer/v1.0.0"},
|
||||||
)
|
)
|
||||||
with urllib.request.urlopen(request, timeout=20) as response:
|
with urllib.request.urlopen(request, timeout=20) as response:
|
||||||
decisions = json.load(response)
|
decisions = json.load(response)
|
||||||
|
|||||||
Reference in New Issue
Block a user