aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodl <[email protected]>2019-04-15 14:26:43 +0200
committercodl <[email protected]>2019-04-15 14:26:43 +0200
commiteca31ea732d1c2c8f0491a138b2940e828a45973 (patch)
tree611e0a28ef365624d25ef2a22a3b69c0307d4b48 /mastodon/Mastodon.py
parent62a47f4e92bd58639beeb682cb7cc53ebba8b803 (diff)
downloadmastodon.py-eca31ea732d1c2c8f0491a138b2940e828a45973.tar.gz
improve link header parameter extraction regex
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r--mastodon/Mastodon.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 123d1a6..3f594cf 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -2272,7 +2272,7 @@ class Mastodon:
2272 if url['rel'] == 'next': 2272 if url['rel'] == 'next':
2273 # Be paranoid and extract max_id specifically 2273 # Be paranoid and extract max_id specifically
2274 next_url = url['url'] 2274 next_url = url['url']
2275 matchgroups = re.search(r"max_id=([^&]+)", next_url) 2275 matchgroups = re.search(r"[?&]max_id=([^&]+)", next_url)
2276 2276
2277 if matchgroups: 2277 if matchgroups:
2278 next_params = copy.deepcopy(params) 2278 next_params = copy.deepcopy(params)
@@ -2290,7 +2290,7 @@ class Mastodon:
2290 if url['rel'] == 'prev': 2290 if url['rel'] == 'prev':
2291 # Be paranoid and extract since_id specifically 2291 # Be paranoid and extract since_id specifically
2292 prev_url = url['url'] 2292 prev_url = url['url']
2293 matchgroups = re.search(r"since_id=([^&]+)", prev_url) 2293 matchgroups = re.search(r"[?&]since_id=([^&]+)", prev_url)
2294 2294
2295 if matchgroups: 2295 if matchgroups:
2296 prev_params = copy.deepcopy(params) 2296 prev_params = copy.deepcopy(params)
Powered by cgit v1.2.3 (git 2.41.0)