From 933e9d75348b46eed7ef27a08e6a8d8d2ded8934 Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Sun, 15 Dec 2019 02:30:29 -0500 Subject: [PATCH 1/2] Fix header requirements for Schwab (bank and brokerage) in cli.py --- CHANGELOG.md | 3 +++ ofxclient/cli.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3025a..502b896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. +## [2.0.5] - XXXX-XX-XX +- Fix Schwab header requirements + ## [2.0.4] - 2019-02-10 - fix a number of python3 encoding issues - fix bug with ConfigParser diff --git a/ofxclient/cli.py b/ofxclient/cli.py index cb2dabc..db5fc69 100644 --- a/ofxclient/cli.py +++ b/ofxclient/cli.py @@ -246,6 +246,11 @@ def client_args_for_bank(bank_info, ofx_version): if 'www.accountonline.com' in bank_info['url']: # Citi needs no User-Agent header client_args['user_agent'] = False + if 'ofx.schwab.com' in bank_info['url'] + # Schwab needs just "application/x-ofx" in the accept header + # and no User-Agent header + client_args['accept'] = "application/x-ofx" + client_args['user_agent'] = False return client_args def write_and_handle_download(ofx_data, name): From 7bd7dfa6e97487da683ade67773976443e7f966a Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Sun, 15 Dec 2019 14:57:57 -0500 Subject: [PATCH 2/2] I don't actually know python: fix syntax error --- ofxclient/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofxclient/cli.py b/ofxclient/cli.py index db5fc69..f8d5354 100644 --- a/ofxclient/cli.py +++ b/ofxclient/cli.py @@ -246,7 +246,7 @@ def client_args_for_bank(bank_info, ofx_version): if 'www.accountonline.com' in bank_info['url']: # Citi needs no User-Agent header client_args['user_agent'] = False - if 'ofx.schwab.com' in bank_info['url'] + if 'ofx.schwab.com' in bank_info['url']: # Schwab needs just "application/x-ofx" in the accept header # and no User-Agent header client_args['accept'] = "application/x-ofx"