From b730eec41c4d1620564201804fa5d7c1eead369c Mon Sep 17 00:00:00 2001 From: Quratulain-bilal Date: Fri, 31 Jul 2026 19:39:55 +0500 Subject: [PATCH] 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. --- src/specify_cli/workflows/_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/specify_cli/workflows/_commands.py b/src/specify_cli/workflows/_commands.py index b465610d3b..8e6b00030d 100644 --- a/src/specify_cli/workflows/_commands.py +++ b/src/specify_cli/workflows/_commands.py @@ -429,7 +429,7 @@ def _read_response_within_limit(response, max_bytes: int | None = None) -> bytes if callable(getheader): try: raw_length = getheader("Content-Length") - except Exception: + except AttributeError: raw_length = None if raw_length is not None: try: