From 94e69e7dc0381578f0b17ac83f5653b69d64b494 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Fri, 16 Jan 2015 16:04:55 +0100 Subject: [PATCH] Fixed exception on trying to forEach empty request headers --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 1202921..5767d2b 100644 --- a/src/main.js +++ b/src/main.js @@ -221,7 +221,7 @@ Formsy.Form = React.createClass({ this.props.onSubmit(); - var headers = (Object.keys(this.props.headers).length && this.props.headers) || options.headers; + var headers = (Object.keys(this.props.headers).length && this.props.headers) || options.headers || {}; ajax[this.props.method || 'post'](this.props.url, this.model, this.props.contentType || options.contentType || 'json', headers) .then(function (response) {