Add 500 error simulation middleware and HTMX integration
This commit is contained in:
@@ -57,5 +57,14 @@
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
{% block modal %}{% endblock %}
|
||||
<script>
|
||||
// Check for global variable to set X-Simulate-500 header
|
||||
// Set the custom header on all HTMX requests
|
||||
document.addEventListener('htmx:configRequest', function (evt) {
|
||||
if (typeof window.simulate500 === 'boolean' && window.simulate500) {
|
||||
evt.detail.headers['X-Simulate-500'] = 'true';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user