Skip to content

Commit e036bb1

Browse files
authored
Merge fbchat-dev#630 PR from original repo
fbchat-dev#630
1 parent 916a140 commit e036bb1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fbchat/_session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717

1818
SERVER_JS_DEFINE_REGEX = re.compile(
19-
r'(?:"ServerJS".{,100}\.handle\({.*"define":)|(?:require\("ServerJSDefine"\)\)?\.handleDefines\()'
19+
r'(?:"ServerJS".{,100}\.handle\({.*"define":)'
20+
r'|(?:ServerJS.{,100}\.handleWithCustomApplyEach\(ScheduledApplyEach,{.*"define":)'
21+
r'|(?:require\("ServerJSDefine"\)\)?\.handleDefines\()'
2022
)
2123
SERVER_JS_DEFINE_JSON_DECODER = json.JSONDecoder()
2224

@@ -411,7 +413,7 @@ def _from_session(cls, session):
411413

412414
# Make a request to the main page to retrieve ServerJSDefine entries
413415
try:
414-
r = session.get(prefix_url("/"), allow_redirects=False)
416+
r = session.get(prefix_url("/"), allow_redirects=True)
415417
except requests.RequestException as e:
416418
_exception.handle_requests_error(e)
417419
_exception.handle_http_error(r.status_code)

0 commit comments

Comments
 (0)