Skip to content

Commit b730eec

Browse files
fix: narrow exception in Content-Length header lookup from Exception to AttributeError
Bare 'except Exception' would swallow MemoryError, RecursionError, etc. The only realistic failure from getheader() is AttributeError.
1 parent 5e2f9bc commit b730eec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/specify_cli/workflows/_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def _read_response_within_limit(response, max_bytes: int | None = None) -> bytes
429429
if callable(getheader):
430430
try:
431431
raw_length = getheader("Content-Length")
432-
except Exception:
432+
except AttributeError:
433433
raw_length = None
434434
if raw_length is not None:
435435
try:

0 commit comments

Comments
 (0)