The "Dumb fix for HTMX Bug" actually breaks RT in the case it is supposed to fix:
# Dumb fix for HTMX Bug which rt team refuses to fix
# the main page does not honor WebPath and breaks if RT is not installed
# in the webserver root
RUN true && \
case "${RT_VERSION}" in \
"6."*) \
sed -i 's/hx-get="<% RT::Interface::Web::RequestENV('"'"'REQUEST_URI'"'"') %>"/hx-get="<%RT->Config->Get('"'"'WebPath'"'"')%><% RT::Interface::Web::RequestENV('"'"'REQUEST_URI'"'"') %>"/' /opt/rt/share/html/Elements/Header \
;; \
esac
with this Caddyfile
:8080 {
log
route /rt* {
uri strip_prefix /rt
reverse_proxy rt:9000 {
transport fastcgi {
env SCRIPT_NAME /rt
}
}
}
}
and RT_SiteConfig.pm
For an URL of http://somewhere:8080/rt/ caddy passes these values:
SCRIPT_NAME=/rt
PATH_INFO=/
REQUEST_URI=/rt/
The "Dumb fix for HTMX Bug" causes hx_get contain the value /rt/rt/ which fails to load properly. It doubles the /rt prefix for other pages like http://somewhere:8080/rt/Dashboards/1/Homepage, causing them to fail to load properly as well.
The "Dumb fix for HTMX Bug" actually breaks RT in the case it is supposed to fix:
with this
Caddyfileand
RT_SiteConfig.pmFor an URL of
http://somewhere:8080/rt/caddy passes these values:The "Dumb fix for HTMX Bug" causes
hx_getcontain the value/rt/rt/which fails to load properly. It doubles the/rtprefix for other pages likehttp://somewhere:8080/rt/Dashboards/1/Homepage, causing them to fail to load properly as well.