Skip to content

Commit

Permalink
Protect ID lookup from redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjrw committed May 7, 2024
1 parent 27296d7 commit b99bec0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions notifier/wikiconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,10 @@ def get_page_id(self, wiki_id: str, slug: str) -> int:
raise RuntimeError(
f"Cannot access page from unsupported wiki {wiki_id}"
) from error
page_url = "http{}://{}.wikidot.com/{}".format(
"s" if wiki["secure"] else "", wiki_id, slug
page_url = (
"http{}://{}.wikidot.com/{}/norender/true/noredirect/true".format(
"s" if wiki["secure"] else "", wiki_id, slug
)
)
page = self._session.get(page_url).text
return int(
Expand Down

0 comments on commit b99bec0

Please sign in to comment.