Skip to content

Commit

Permalink
Merge pull request #7228 from ElasticRun/develop
Browse files Browse the repository at this point in the history
feat: Add frappe cmd and doctype to request headers for analytics and load balancing
  • Loading branch information
rmehta committed May 20, 2019
2 parents cf8a53e + 0ea9a01 commit 91ce69b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frappe/public/js/frappe/request.js
Expand Up @@ -197,11 +197,16 @@ frappe.request.call = function(opts) {
async: opts.async,
headers: Object.assign({
"X-Frappe-CSRF-Token": frappe.csrf_token,
"Accept": "application/json"
"Accept": "application/json",
"X-Frappe-CMD": opts.get('args', {}).get('cmd', '')
}, opts.headers),
cache: false
};

if (opts.args && opts.args.doctype) {
ajax_args.headers["X-Frappe-Doctype"] = opts.args.doctype;
}

frappe.last_request = ajax_args.data;

return $.ajax(ajax_args)
Expand Down

0 comments on commit 91ce69b

Please sign in to comment.