Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #46 - Vanguard download problems
This provides a fix for the Vanguard downloading problems. It may also fix other banks that decide to follow the same pattern...
I found that PocketSense users were having the same problem with Vanguard. That application's developer determined that Vanguard now requires cookie handling; the original request to Vanguard returns a HTTP 200 with a 0-length body, but a number of
Set-Cookie
headers. Re-sending the request with the appropriateCookie
headers returns the proper OFX.This PR includes:
Client.post()
so it builds a list of headers and then puts them all at once, logging the headers as it does. Previously, the request body (query) was logged at debug level but the headers were not, and headers appear to be more problematic lately.Client.post()
method toClient._do_post()
and create a newClient.post()
wrapper method. This wrapper calls.post()
and if (and only if) the response has 0 length, an HTTP 200 return code, and one or moreSet-Cookie
headers present, it retries the request with the proper Cookie header set and returns that response.I've tested this just now and it works properly to fix the Vanguard problem, and also works with American Express, Citi Cards, Discover and TIAA-CREF.