eshq/eventsource-broker — pull request #1 by melvynhills (2012-10-18 14:43:17+00:00)
Title: Add AJAX headers option

If an AJAX request is sent without proper CSRF token, Rails destroys current session.
This pull request adds an `ajax_headers` option for the ESHQ constructor.
This option must be a key:value object. Value can also be a function.

```javascript
var eshq = new ESHQ("my-channel", {
auth_url: "/live/connect",
ajax_headers: {
"X-CSRF-Token": function() {
return $("meta[name='csrf-token']").attr("content");
}
}
});
```