Jumbled fields if form fields left blank? #2

Closed
codedmart opened this Issue Oct 29, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@codedmart

If I fill in all the fields I get this when I console log req.body which is correct:

{ _csrf: 'Nv6RqABrHOQfLxoGVBYrHz2r',
company_name: 'Zac Scott Homes',
broker: 'Coldwell Banker',
address: '1111 Northwest Blvd',
city: 'Coeur D\' Alene',
state: 'ID',
zip: '83814',
phone: '(509) 555-5555',
fax: '(208) 555-5555',
subdomain: 'domain',
personal_domain: 'domain.local,www.domain.local',
commit: 'SUBMIT >>',
broker_logo: 'tmp/Freahbooks.1319848442404.png',
personal_logo: 'tmp/Freshbooks.1319848442404.jpg' }

If I have some form fields blank then I get improper data (I left company_name, broker, address, broker_logo, and personal_logo blank):

{ _csrf: 'Nv6RqABrHOQfLxoGVBYrHz2r',
company_name: '\r\n------WebKitFormBoundary6SU4gAdLvhxvTsKL\r\nContent-Disposition: form-data; name="broker"\r\n\r\n',
address: '\r\n------WebKitFormBoundary6SU4gAdLvhxvTsKL\r\nContent-Disposition: form-data; name="city"\r\n\r\nCoeur D\' Alene',
state: 'ID',
zip: '83814',
phone: '(509) 555-5555',
fax: '(208) 555-5555',
subdomain: 'domain',
personal_domain: 'domain.local,www.domain.local',
broker_logo: '\r\n------WebKitFormBoundary6SU4gAdLvhxvTsKL\r\nContent-Disposition: form-data; name="personal_logo"; filename=""\r\nContent-Type: application/octet-stream\r\n\r\n',
commit: 'SUBMIT >>' }
@chjj

This comment has been minimized.

Show comment
Hide comment
@chjj

chjj Oct 29, 2011

Owner

That is a bug, and something I regrettably didn't think to test for.

Just fixed: 1b48160

It was a small arithmetic problem. (A single line where i = 0 needed to be i = -1). I'm pushing an immediate NPM update. Thanks a lot for pointing this out.

Owner

chjj commented Oct 29, 2011

That is a bug, and something I regrettably didn't think to test for.

Just fixed: 1b48160

It was a small arithmetic problem. (A single line where i = 0 needed to be i = -1). I'm pushing an immediate NPM update. Thanks a lot for pointing this out.

@chjj chjj closed this Oct 29, 2011

@codedmart

This comment has been minimized.

Show comment
Hide comment
@codedmart

codedmart Oct 29, 2011

Awesome! Thanks for the plugin!

Awesome! Thanks for the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment