diff --git a/pygitguardian/client.py b/pygitguardian/client.py index 61d96266..db8f2f2f 100644 --- a/pygitguardian/client.py +++ b/pygitguardian/client.py @@ -584,9 +584,10 @@ def read_metadata(self) -> Optional[Detail]: result.status_code = resp.status_code return result metadata = ServerMetadata.from_dict(resp.json()) - metadata.secret_scan_preferences.general__maximum_payload_size = ( - metadata.preferences["general__maximum_payload_size"] - ) + if "general__maximum_payload_size" in metadata.preferences: + metadata.secret_scan_preferences.general__maximum_payload_size = ( + metadata.preferences["general__maximum_payload_size"] + ) self.secret_scan_preferences = metadata.secret_scan_preferences return None diff --git a/pygitguardian/config.py b/pygitguardian/config.py index adb1790c..462d4656 100644 --- a/pygitguardian/config.py +++ b/pygitguardian/config.py @@ -4,4 +4,4 @@ MULTI_DOCUMENT_LIMIT = 20 DOCUMENT_SIZE_THRESHOLD_BYTES = 1048576 # 1MB -GENERAL_MAXIMUM_PAYLOAD = 2621440 # 2.5MB +GENERAL_MAXIMUM_PAYLOAD = 2621440 # 25MB