Fixed exception on trying to forEach empty request headers

This commit is contained in:
Tomasz Sterna 2015-01-16 16:04:55 +01:00
parent b8c4414976
commit 94e69e7dc0
1 changed files with 1 additions and 1 deletions

View File

@ -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) {