AjaxSource extra request headers not getting passed


I'm trying to add a request header to my AjaxSource. Subsequent requests don't seem to pass the header. Request was inspected in debugger and the request parameter was not added.

How do I add the header to the AjaxSource request?
var kind = require('enyo/kind'),
    AjaxSrc = require('enyo/AjaxSource'), 
    Ajax = require('enyo/Ajax');

var metas = document.getElementsByTagName('meta'); 
var csrfToken;

for (var i=0; i


  • I'm going to answer my own questions. Looking back a one of my previous discussions, I figured it out. I need to put the header on the actual Ajax call. So the code looks like this.

    this.model.commit({headers: FCAjax.csrfToken});

    I was hoping I could just set it on the source so every request made would get the token, but I guess this will have to do.
Sign In or Register to comment.