mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Insert CSRF token using meta tag in common_layout.html
<body> 태그의 속성이나 그 밖의 태그를 사용하지 않는 이유는 <body>가 로딩되기 전에 먼저 AJAX 요청을 시도하는 서드파티 자료가 있기 때문이다. <head> 상단에 CSRF 토큰을 넣어야 이런 자료에서도 토큰이 누락되지 않는다. 다른 CSM나 프레임워크들도 <head> 상단에 <meta> 태그를 사용하여 CSRF 토큰을 삽입하는 사례가 많으며, csrf-token은 이런 용도로 WHATWG에 공식적으로 등록된 meta name이다. cf. https://wiki.whatwg.org/wiki/MetaExtensions
This commit is contained in:
parent
a0f2388842
commit
e2511a0269
1 changed files with 1 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
<block loop="Context::getMetaTag() => $no, $val">
|
||||
<meta http-equiv="{$val['name']}"|cond="$val['is_http_equiv']" name="{$val['name']}"|cond="!$val['is_http_equiv']" content="{$val['content']}" />
|
||||
</block>
|
||||
<meta name="csrf-token" content="{$is_logged ? \Rhymix\Framework\Session::getGenericToken() : ''}" />
|
||||
|
||||
<!-- TITLE -->
|
||||
<title>{Context::getBrowserTitle()}</title>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue