diff options
author | Lorenz Diener <[email protected]> | 2017-09-05 16:39:17 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2017-09-05 16:39:17 +0200 |
commit | 1c93e350f74626b67bb50503d6ee6fcb9656bc2b (patch) | |
tree | b0339e50672314da3e67a9456eeda6e967aa29c3 | |
parent | 87ee1df1c0e045243a486ff43514028e49f44386 (diff) | |
download | mastodon.py-1c93e350f74626b67bb50503d6ee6fcb9656bc2b.tar.gz |
Fix crash on URLs with no 'rel' attribute (Fixes #79)
-rw-r--r-- | mastodon/Mastodon.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 6513c33..d5c6225 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -960,6 +960,9 @@ class Mastodon: | |||
960 | if isinstance(response, list) and 'Link' in response_object.headers and response_object.headers['Link'] != "": | 960 | if isinstance(response, list) and 'Link' in response_object.headers and response_object.headers['Link'] != "": |
961 | tmp_urls = requests.utils.parse_header_links(response_object.headers['Link'].rstrip('>').replace('>,<', ',<')) | 961 | tmp_urls = requests.utils.parse_header_links(response_object.headers['Link'].rstrip('>').replace('>,<', ',<')) |
962 | for url in tmp_urls: | 962 | for url in tmp_urls: |
963 | if not 'rel' in url: | ||
964 | continue | ||
965 | |||
963 | if url['rel'] == 'next': | 966 | if url['rel'] == 'next': |
964 | # Be paranoid and extract max_id specifically | 967 | # Be paranoid and extract max_id specifically |
965 | next_url = url['url'] | 968 | next_url = url['url'] |