Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
superhawk610 committed Jan 4, 2021
1 parent 2c755f9 commit 135a3a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ func (or *Response) readSGMLHeaders(r *bufio.Reader) error {
// optionally captured & discarded by the trailing `\s*`. Valid SGML headers must
// always be present in exactly this order, so a regular expression is acceptable.
headerExp := regexp.MustCompile(
`OFXHEADER:\s*(?P<OFXHEADER>\d+)\s*` +
`^OFXHEADER:\s*(?P<OFXHEADER>\d+)\s*` +
`DATA:\s*(?P<DATA>[A-Z]+)\s*` +
`VERSION:\s*(?P<VERSION>\d+)\s*` +
`SECURITY:\s*(?P<SECURITY>[\w]+)\s*` +
`ENCODING:\s*(?P<ENCODING>[A-Z0-9-]+)\s*` +
`CHARSET:\s*(?P<CHARSET>[\w-]+)\s*` +
`COMPRESSION:\s*(?P<COMPRESSION>[A-Z]+)\s*` +
`OLDFILEUID:\s*(?P<OLDFILEUID>[\w-]+)\s*` +
`NEWFILEUID:\s*(?P<NEWFILEUID>[\w-]+)\s*`)
`NEWFILEUID:\s*(?P<NEWFILEUID>[\w-]+)\s*<$`)

matches := headerExp.FindStringSubmatch(s)
if len(matches) == 0 {
Expand Down
3 changes: 1 addition & 2 deletions response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ func TestValidSamples(t *testing.T) {

func TestInvalidResponse(t *testing.T) {
// in this example, the severity is invalid due to mixed upper and lower case letters
const invalidResponse = `
OFXHEADER:100
const invalidResponse = `OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
Expand Down
File renamed without changes.

0 comments on commit 135a3a5

Please sign in to comment.