diff options
author | Lorenz Diener <[email protected]> | 2017-08-12 12:44:56 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-08-12 12:44:56 +0200 |
commit | fccc4e19866442c609ddddf9d112c6c14ab20d1e (patch) | |
tree | 5fec5ea271f8d2913f1bc74bc67c8c6091b6e4bd /mastodon | |
parent | b2a8f0db44b0fdaf692cdcec312a8cba7c28ccab (diff) | |
parent | 4efebe2c9f6550c8a0bf109bfc802743faaabbeb (diff) | |
download | mastodon.py-fccc4e19866442c609ddddf9d112c6c14ab20d1e.tar.gz |
Merge pull request #67 from Chronister/handle_empty_link
Handle case of empty 'Link' header from server
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 3b186fe..8aa741a 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -957,7 +957,7 @@ class Mastodon: | |||
957 | raise MastodonAPIError("Could not parse response as JSON, response code was %s, bad json content was '%s'" % (response_object.status_code, response_object.content)) | 957 | raise MastodonAPIError("Could not parse response as JSON, response code was %s, bad json content was '%s'" % (response_object.status_code, response_object.content)) |
958 | 958 | ||
959 | # Parse link headers | 959 | # Parse link headers |
960 | if isinstance(response, list) and 'Link' in response_object.headers: | 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 url['rel'] == 'next': | 963 | if url['rel'] == 'next': |