Skip to content

Loading…

Jumbled fields if form fields left blank? #2

Closed
codedmart opened this Issue · 2 comments

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
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.

@chjj chjj closed this
@codedmart

Awesome! Thanks for the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.