From 314d197e2450768a62cd0e1c101cc780d82535d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?cat=20=C3=A6scling?= <11325618-aescling@users.noreply.gitlab.com> Date: Thu, 27 Jul 2023 00:50:16 -0400 Subject: [PATCH] httpd.execline: style: flatten resource logic --- visible-to-httpd/binaries/httpd.execline | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/visible-to-httpd/binaries/httpd.execline b/visible-to-httpd/binaries/httpd.execline index 028d821..24f6fc5 100755 --- a/visible-to-httpd/binaries/httpd.execline +++ b/visible-to-httpd/binaries/httpd.execline @@ -58,24 +58,20 @@ if -X -n -t { backtick -n resource { cd supported_domains - backtick -E -n candidate_resource { - backtick -E -n without_dot_and_dot_dot { - backtick -E -n without_query_string { - case -N -- ${requested_resource} { - "(.*)[?#].*" { - elgetpositionals - s6-echo -n -- ${1} - } - } - s6-echo -n -- ${requested_resource} + backtick -E -n without_query_string { + case -N -- ${requested_resource} { + "(.*)[?#].*" { + elgetpositionals + s6-echo -n -- ${1} } - pipeline { clean-dot-directories.execline ${without_query_string} } - urlencode -d } - - # include the hostname in the final resource name - s6-echo -n -- ${hostname}/${without_dot_and_dot_dot} + s6-echo -n -- ${requested_resource} + } + backtick -E -n without_dot_and_dot_dot { + pipeline { clean-dot-directories.execline ${without_query_string} } + urlencode -d } + define candidate_resource ${hostname}/${without_dot_and_dot_dot} # `${directory}` -> `${directory}/index.xhtml` ifelse { eltest -d \${candidate_resource} } -- 2.47.3