-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
I'm using hinclude to include a CSRF token in a laravel blade page that has been cached with HTTPCache.
When I put the CSRF token inside the body tag, everything works as expected.
<body>
<form>
<hx:include src="/csrf/input">
<input type="hidden" name="_token" value="2viCQ8L7G0aHOsEQwf811kR2wLoozZl3uhEemshv">
</hx:include>
</form>
</body>
But when I put the CSRF token in a meta tag in the head (for AJAX requests), the head gets mixed up when I look in the web inspector. The hx:include tag has been moved to the body(!), and every tag that comes AFTER the hx:include tag in the head, is also moved to the body. See code example below.
My question is: am I doing something wrong here? Or are we not supposed to us the hx:include tag in the head?
View source (Chrome):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/themes/ambion2020/js/vendor/hinclude/hinclude.js"></script>
<hx:include src="/csrf/meta"></hx:include>
<meta name="description" content="">
<meta name="keywords" content="">
</head>
<body>
<div class="wrapper"></div>
</body>
</html>
Web Inspector (Chrome/Firefox):
<html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/themes/ambion2020/js/vendor/hinclude/hinclude.js"></script>
</head>
<body>
<hx:include src="/csrf/meta" class="included include_200">
<meta name="csrf-token" content="2viCQ8L7G0aHOsEQwf811kR2wLoozZl3uhEemshv">
</hx:include>
<meta name="description" content="">
<meta name="keywords" content="">
<div class="wrapper"></div>
</body>
</html>
Metadata
Metadata
Assignees
Labels
No labels