]> cat aescling's git repositories - httpd-execline.git/commitdiff
http-header-parse.execline: convert parsed header names to lowercase
authoraescling <11325618-aescling@users.noreply.gitlab.com>
Sat, 16 Apr 2022 06:19:29 +0000 (06:19 +0000)
committeraescling <11325618-aescling@users.noreply.gitlab.com>
Sat, 16 Apr 2022 06:27:38 +0000 (06:27 +0000)
Update all lookups for what is now called httpd_header_parse_host

* Fix accidental whitespace errors

visible-to-httpd/binaries/http-error-response.execline
visible-to-httpd/binaries/http-get-extra-headers.execline
visible-to-httpd/binaries/http-header-parse.execline
visible-to-httpd/binaries/http-print-header-files.execline
visible-to-httpd/binaries/httpd.execline

index 0311e21a28e7ff8df37ff1eecc6ef71a0d2975fe..c388f666812c82bf1233e6a0c7bd51db3822e66e 100755 (executable)
@@ -16,7 +16,7 @@ backtick -n extra_headers { http-get-extra-headers.execline ${1} }
 multisubstitute {
        importas -i -u Date Date
        importas -i -u extra_headers extra_headers
-       importas -D "?? no hostname ??" hostname http_header_parse_Host
+       importas -D "?? no hostname ??" hostname http_header_parse_host
 }
 
 backtick -x -n error_response_directory {
index 78c9c2611856fc5cef1507f5a94935e3deb48d80..2cacb1f78607922fb46b72df0c08328d4c78f9f3 100755 (executable)
@@ -17,7 +17,7 @@
 # TODO: write a GUI?? with like, `yad(1)` or something??? idk
 
 multisubstitute {
-       importas -D -no_hostname_parsed hostname http_header_parse_Host
+       importas -D -no_hostname_parsed hostname http_header_parse_host
        importas -D -no_resource_parsed resource resource
 }
 
index 7a0f3f512f719925659d4d8e74ac8ac7735d5e63..73317c5d44fdbb50a765a620c05c0dbb433003f5 100755 (executable)
@@ -73,7 +73,7 @@ ifelse {
 {
        # the client MUST send a Host header, halt otherwise
        #
-       ifelse { s6-test ! -v http_header_parse_Host }
+       ifelse { s6-test ! -v http_header_parse_host }
        {
                http-error-response.execline
                        400
@@ -95,6 +95,7 @@ ifelse {
 backtick -x -n header_name {
        pipeline { printenv current_line }
        pipeline { sed -n "s/^([^ :]+):.*/\\1/p" }
+       pipeline { tr A-Z a-z }
        read
 }
 backtick -x -n header_contents {
@@ -113,7 +114,7 @@ ifelse {
 }
 {
        importas -i current_line current_line
-       http-error-response.execline
+               http-error-response.execline
                400
                "syntax error"
                "http-header-parse.execline: bad header line: \""${current_line}\"
@@ -130,11 +131,11 @@ multisubstitute {
 # TODO: [hard, design problem]: short circuit but exec(3p) into the
 # remaining program
 # 
-ifelse { s6-test \${header_name} = Host }
+ifelse { s6-test \${header_name} = host }
 {
        # we MUST 400 on multiple Host headers
        #
-       ifelse { s6-test -v http_header_parse_Host }
+       ifelse { s6-test -v http_header_parse_host }
        {
                http-error-response.execline
                        400
index f348e013d24608ef9b878c1118856206ac563c4d..e0a588e8fc560b8d65405d2dfd048bb1e78fdb3b 100755 (executable)
@@ -41,7 +41,7 @@ ifelse { s6-test -v http_print_header_directories_${header_name} }
 # otherwise, print out the header line
 
 multisubstitute {
-       importas -D -no_hostname_parsed hostname http_header_parse_Host
+       importas -D -no_hostname_parsed hostname http_header_parse_host
        importas -D -no_resource_parsed requested_resource http_start_line_parse_resource
 }
 # wrapper around s6-echo for hostname and resource substitutions in header contents
index 86c7a9f41450f7fe870326085a80f79173a15026..b38f3dd754c233e5314a22a64e5296942e90e760 100755 (executable)
@@ -88,7 +88,7 @@ if -X -n -t {
        # http_header_parse_${Header_Name}.  
        # that said, we use only `Host` here.  
        # `/http-header-parse.execline` is implemented in a wonderfully silly way
-       importas -i hostname http_header_parse_Host
+       importas -i hostname http_header_parse_host
 
        # we don’t need to read anything more from the client
        heredoc 0 ""