mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-18 22:46:33 +00:00
12 lines
308 B
JavaScript
12 lines
308 B
JavaScript
|
$(function () {
|
||
|
|
||
|
// fetch the CSRF token from the meta tag
|
||
|
var token = $("meta[name='_csrf']").attr("content");
|
||
|
|
||
|
// ensure every Ajax request has the CSRF token
|
||
|
// included in the request's header.
|
||
|
$(document).ajaxSend(function(e, xhr, options) {
|
||
|
xhr.setRequestHeader("X-CSRF-TOKEN", token);
|
||
|
});
|
||
|
});
|