1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-07-01 19:58:37 -04:00

Support carriage returns on new lines

This commit is contained in:
John Starich
2019-06-14 00:40:22 -05:00
committed by Aaron Lindsay
parent f41286cac7
commit 67e527c855
8 changed files with 39 additions and 9 deletions

View File

@ -19,6 +19,8 @@ type BasicClient struct {
// Don't insert newlines or indentation when marshalling to SGML/XML
NoIndent bool
// Use carriage returns on new lines
CarriageReturn bool
}
// OfxVersion returns the OFX specification version this BasicClient will marshal
@ -54,6 +56,11 @@ func (c *BasicClient) IndentRequests() bool {
return !c.NoIndent
}
// CarriageReturnNewLines returns true if carriage returns should be used on new lines, false otherwise
func (c *BasicClient) CarriageReturnNewLines() bool {
return c.CarriageReturn
}
func (c *BasicClient) RawRequest(URL string, r io.Reader) (*http.Response, error) {
if !strings.HasPrefix(URL, "https://") {
return nil, errors.New("Refusing to send OFX request with possible plain-text password over non-https protocol")