Skip to content

Commit f13afa0

Browse files
committed
Only use the path from the next_url when iterating over resources.
1 parent 060baf1 commit f13afa0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Add github workflow to build netlify docs.
1515
- Run tests on pull requests to 1.x.
1616
- Test `resource.iterate` method with a page limit.
17+
- Only use the path from the `next_url` when iterating over resources.
1718

1819
### Fixed
1920
- Do not include the endpoint property in the serialized subrequest.

farmOS/client_2.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from urllib.parse import urlparse
23

34
logger = logging.getLogger(__name__)
45
logger.addHandler(logging.NullHandler())
@@ -44,7 +45,9 @@ def iterate(self, entity_type, bundle=None, params=None):
4445
yield from response["data"]
4546
try:
4647
next_url = response["links"]["next"]["href"]
47-
response = self.session._http_request(url=next_url)
48+
parsed_url = urlparse(next_url)
49+
next_path = parsed_url._replace(scheme="", netloc="").geturl()
50+
response = self.session.http_request(path=next_path)
4851
response = response.json()
4952
except KeyError:
5053
more = False

0 commit comments

Comments
 (0)