Skip to content

Commit

Permalink
fix(payload): make payload optional and default to 25MB (internal mon…
Browse files Browse the repository at this point in the history
…itoring default)
  • Loading branch information
fnareoh committed Jan 3, 2024
1 parent c82b140 commit 7c53cc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pygitguardian/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pygitguardian/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7c53cc9

Please sign in to comment.