Skip to content

Commit

Permalink
Fix Vanguard by handling status 500 with cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurdave committed Feb 25, 2022
1 parent 4da2719 commit 8d68937
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ofxclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def post(self, query):
"""
res, response = self._do_post(query)
cookies = res.getheader('Set-Cookie', None)
if len(response) == 0 and cookies is not None and res.status == 200:
if ((len(response) == 0 and cookies is not None and res.status in [200, 500]) or
cookies is not None and res.status == 500):
logging.debug('Got 0-length 200 response with Set-Cookies header; '
'retrying request with cookies')
_, response = self._do_post(query, [('Cookie', cookies)])
Expand Down

0 comments on commit 8d68937

Please sign in to comment.