Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prismic/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def preview_session(self, token, link_resolver, default_url):

:return: the URL to redirect the user to
"""
main_document_id = get_json(token, request_handler=self.request_handler).get("mainDocument")
main_document_id = get_json(token, request_handler=self.request_handler, cache=self.cache).get("mainDocument")
if main_document_id is None:
return default_url
response = self.form("everything").ref(token).query(predicates.at("document.id", main_document_id)).submit()
Expand Down
2 changes: 1 addition & 1 deletion prismic/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_json(url, params=None, access_token=None, cache=None, ttl=None, request_


def get_max_age(headers):
expire_header = headers["Cache-Control"]
expire_header = headers.get("Cache-Control")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, drats, I missed this PR--- I also fixed it over here. #26

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, so i'll close the PR..

Thanks for the alert. :)

if expire_header is not None:
m = re.match("max-age=(\d+)", expire_header)
if m:
Expand Down