-
Notifications
You must be signed in to change notification settings - Fork 50
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
OFXHEADER value not trimmed #25
Comments
It seems like we should just fix the code if someone is sending it that way. I'm happy to take and merge a pull request if you want to put one together. |
I downloaded master, created a branch, committed the change to the branch. When I attempted to push the branch up, I got: git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --set-upstream origin bug-OFXHEADER_Value_Trim:bug-OFXHEADER_Value_Trim So I guess I need privileges to create a branch? |
You need to fork the project, push the changes to your fork, then create a pull request from that fork. |
Looks like I accidentally closed this issue and I have now reopened it. I've created the pull request. |
I am dealing with a bank who sends the following header:
OFXHEADER: 100
DATA: OFXSGML
VERSION: 102
SECURITY: NONE
ENCODING: USASCII
CHARSET: 1252
COMPRESSION: NONE
OLDFILEUID: NONE
NEWFILEUID: NONE
Note that there is a space after the colon before the value. This is causing the following parse error:
java.lang.IllegalArgumentException: No enum constant net.sf.ofx4j.domain.data.ApplicationSecurity. NONE
at java.lang.Enum.valueOf(Enum.java:238)
at net.sf.ofx4j.io.DefaultStringConversion.fromString(DefaultStringConversion.java:81)
at net.sf.ofx4j.io.AggregateStackContentHandler.onHeader(AggregateStackContentHandler.java:50)
at net.sf.ofx4j.io.BaseOFXReader.processOFXv1Headers(BaseOFXReader.java:193)
at net.sf.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:111)
at net.sf.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:68)
at net.sf.ofx4j.io.AggregateUnmarshaller.unmarshal(AggregateUnmarshaller.java:44)
If I remove the space, it all parses fine. I looked at processOFXv1Headers and it does NOT trim the value. However, I also see that processOFXv2Headers DOES trim the header.
I looked at spec and it was unclear to me if v1 does NOT allow a space and v2 does?
So is this an issue the bank needs to fix or should OFX4J trim the v1 value also? Should this question be asked elsewhere?
The text was updated successfully, but these errors were encountered: