Commit c15e5739 authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

test dynamic header

parent 52fb7455
Pipeline #123 passed with stage
in 9 seconds
......@@ -22,20 +22,24 @@ function userAuthenticated(){
}
function readCookie(name) {
var nameEQ = encodeURIComponent(name) + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ')
c = c.substring(1, c.length);
if (c.indexOf(nameEQ) === 0)
return decodeURIComponent(c.substring(nameEQ.length, c.length));
function readCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
return null;
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function sendRequest(URL){
console.log(docuemnt.cookie);
let xhr = new XMLHttpRequest();
xhr.open("POST", URL, true);
let token = readCookie("XSRF-TOKEN");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment