Fixed paths generated using app.request.requestUri when in a reverse proxy with a subpath

Related to issue #428
This commit is contained in:
Jan Böhmer 2023-11-11 23:14:22 +01:00
parent 5f86253b94
commit 7163df6d46
9 changed files with 10 additions and 9 deletions

View file

@ -19,7 +19,8 @@
{% macro partsDatatableWithForm(datatable, state_save_tag = 'parts') %}
<form method="post" action="{{ path("table_action") }}"
{{ stimulus_controller('elements/datatables/parts', {"stateSaveTag": state_save_tag}) }} data-dt-settings='{{ datatable_settings(datatable)|escape('html_attr') }}' data-dt-url="{{ app.request.requestUri }}"
{# The app.request.baseUrl here is important or it wont work behind a reverse proxy with subfolder #}
{{ stimulus_controller('elements/datatables/parts', {"stateSaveTag": state_save_tag}) }} data-dt-settings='{{ datatable_settings(datatable)|escape('html_attr') }}' data-dt-url="{{ app.request.baseUrl ~ app.request.requestUri }}"
{{ stimulus_action('elements/datatables/parts', 'confirmDeletionAtSubmit') }} data-delete-title="{% trans %}part_list.action.delete-title{% endtrans %}"
data-delete-message="{% trans %}part_list.action.delete-message{% endtrans %}">
<input type="hidden" name="_token" value="{{ csrf_token('table_action') }}">