fix ruff S310 audit warnings in fpaste
All checks were successful
CI / Lint & Format (push) Successful in 24s
CI / Security Scan (push) Successful in 23s
CI / Memory Leak Check (push) Successful in 21s
CI / SBOM Generation (push) Successful in 22s
CI / Security Tests (push) Successful in 27s
CI / Unit Tests (push) Successful in 36s
All checks were successful
CI / Lint & Format (push) Successful in 24s
CI / Security Scan (push) Successful in 23s
CI / Memory Leak Check (push) Successful in 21s
CI / SBOM Generation (push) Successful in 22s
CI / Security Tests (push) Successful in 27s
CI / Unit Tests (push) Successful in 36s
This commit is contained in:
4
fpaste
4
fpaste
@@ -134,10 +134,10 @@ def request(
|
|||||||
) -> tuple[int, bytes, dict[str, str]]:
|
) -> tuple[int, bytes, dict[str, str]]:
|
||||||
"""Make HTTP request and return (status, body, headers)."""
|
"""Make HTTP request and return (status, body, headers)."""
|
||||||
headers = headers or {}
|
headers = headers or {}
|
||||||
req = urllib.request.Request(url, data=data, headers=headers, method=method)
|
req = urllib.request.Request(url, data=data, headers=headers, method=method) # noqa: S310
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with urllib.request.urlopen(req, timeout=30, context=ssl_context) as resp: # nosec B310
|
with urllib.request.urlopen(req, timeout=30, context=ssl_context) as resp: # noqa: S310 # nosec B310
|
||||||
return resp.status, resp.read(), dict(resp.headers)
|
return resp.status, resp.read(), dict(resp.headers)
|
||||||
except urllib.error.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
return e.code, e.read(), dict(e.headers)
|
return e.code, e.read(), dict(e.headers)
|
||||||
|
|||||||
Reference in New Issue
Block a user