Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make User-Agent header configurable #100

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

aclindsa
Copy link
Contributor

I've come across an FI which dislikes the HTTP User-Agent header being empty (coincidentally the same that doesn't like NEWFILEUID), but others have found FIs which dislike it containing different values... so is it time to parameterize it? This PR leaves the default behavior unchanged, but adds a parameter to OFXClient and a matching argument to ofxget to support overriding the user agent

This commit allows me to successfully make requests to this FI with ofxtools.

Question: Given our previous discussion about how to organize the arguments in ofxget - where would you like this one? I'm not sure I would think of an HTTP header as a 'formatting' argument, but I think it likely applies to the same set of subcommands...

I've come across an FI which dislikes User-Agent being empty, but others
have found FIs which dislike it containing different values.
@csingley
Copy link
Owner

so is it time to parameterize it?

If it's useful, why not? Incidentally, what value of User-Agent is acceptable to your FI?

Given our previous discussion about how to organize the arguments in ofxget - where would you like this one?

For the time being it looks fine to me where it is, right next to the other transport-layer option (skip SSL cert verification). More importantly, the implementation in OFXClient looks right (i.e. set as an instance variable by __init__())

This all seems fine & well. At some point some unit tests exercising the new functionality ought to go in though...

@csingley csingley merged commit 86aa1c2 into csingley:master Nov 16, 2020
@aclindsa aclindsa deleted the client_set_user_agent branch November 16, 2020 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants