Add 500 error simulation middleware and HTMX integration

This commit is contained in:
Bryce
2025-08-12 07:18:55 -07:00
parent cc1523cbb2
commit c159393809
5 changed files with 144 additions and 0 deletions

View File

@@ -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>