Skip to content

Commit c00e9a7

Browse files
committed
Set max_redirects to 0
1 parent 371eb31 commit c00e9a7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# PyMagento Changelog
22

3+
## 2.10.0 (unreleased)
4+
5+
### Breaking changes
6+
7+
* `.max_redirects` now defaults to `0`. The Magento API should never redirect, so it’s safer to raise an error if it
8+
does.
9+
310
## 2.9.0 (2025/11/03)
411

512
### Breaking changes

magento/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ def __init__(self,
124124
if batch_page_size is not None:
125125
self.PAGE_SIZE = batch_page_size
126126

127+
# Redirects shouldn't happen on the API. If they do, raise a clear error so we can debug
128+
self.max_redirects = 0
129+
127130
self.scope = scope
128131
self.headers["Authorization"] = f"Bearer {token}"
129132

0 commit comments

Comments
 (0)