aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChronister <[email protected]>2017-08-11 17:40:04 -0700
committerChronister <[email protected]>2017-08-11 17:40:04 -0700
commit4efebe2c9f6550c8a0bf109bfc802743faaabbeb (patch)
tree920aeb4646f8d54d1f54d1505c27141c5683fda6
parentd1b7d89eaa388d48ffb8e0b47ed023a6958e8823 (diff)
downloadmastodon.py-4efebe2c9f6550c8a0bf109bfc802743faaabbeb.tar.gz
Handle case of empty 'Link' header from server
-rw-r--r--mastodon/Mastodon.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 7203c8a..0ef62bf 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':
Powered by cgit v1.2.3 (git 2.41.0)