From: cat æscling <11325618-aescling@users.noreply.gitlab.com> Date: Thu, 27 Jul 2023 04:50:16 +0000 (-0400) Subject: httpd.execline: style: flatten resource logic X-Git-Tag: v1.0.0~14 X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=314d197e2450768a62cd0e1c101cc780d82535d8;p=httpd-execline.git httpd.execline: style: flatten resource logic --- 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} }