01_FHEMWEB.pm: add csrfToken to the HTTP header (Forum #66484)

git-svn-id: https://svn.fhem.de/fhem/trunk@13348 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2017-02-06 21:46:25 +00:00
parent fb524a8876
commit f89fcdc22a

View File

@@ -412,6 +412,8 @@ FW_Read($$)
"Access-Control-Allow-Headers: Origin, Authorization, Accept\r\n".
"Access-Control-Allow-Credentials: true\r\n".
"Access-Control-Max-Age:86400\r\n" : "");
$FW_headerlines .= "X-FHEM-csrfToken: $defs{$FW_wname}{CSRFTOKEN}\r\n"
if($defs{$FW_wname}{CSRFTOKEN});
#########################
# Return 200 for OPTIONS or 405 for unsupported method