Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Administrator
m4lab_landing_page
Commits
52fb7455
Commit
52fb7455
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
test dynamic header
parent
6296d7a7
master
testing
No related merge requests found
Pipeline
#122
passed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/headfoot.js
+14
-1
js/headfoot.js
with
14 additions
and
1 deletion
+14
-1
js/headfoot.js
+
14
-
1
View file @
52fb7455
...
@@ -22,10 +22,23 @@ function userAuthenticated(){
...
@@ -22,10 +22,23 @@ 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
));
}
return
null
;
}
function
sendRequest
(
URL
){
function
sendRequest
(
URL
){
let
xhr
=
new
XMLHttpRequest
();
let
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
"
POST
"
,
URL
,
true
);
xhr
.
open
(
"
POST
"
,
URL
,
true
);
let
token
=
$
(
"
meta[name='_csrf']
"
).
attr
(
"
content
"
);
let
token
=
readCookie
(
"
XSRF-TOKEN
"
);
//Send the proper header information along with the request
//Send the proper header information along with the request
xhr
.
setRequestHeader
(
'
X-CSRF-TOKEN
'
,
token
);
xhr
.
setRequestHeader
(
'
X-CSRF-TOKEN
'
,
token
);
xhr
.
send
();
xhr
.
send
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets