]> cat aescling's git repositories - httpd-execline.git/commitdiff
bugfix: respond for any sytactically valid Hosts
authorsingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Wed, 8 Sep 2021 00:39:36 +0000 (00:39 +0000)
committersingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Wed, 8 Sep 2021 01:11:43 +0000 (01:11 +0000)
as a fallback, make sure to send a response even when invalid
hostnames are required

visible-to-httpd/binaries/http-get-extra-headers.execline
visible-to-httpd/binaries/http-header-parse.execline

index 0bee83194a71899fdf67e8c3ad54c2ceb7b9f659..35185fae40ac6c86ff0b5ccc2bf640d7f38d77f6 100755 (executable)
@@ -17,7 +17,7 @@
 # TODO: write a GUI?? with like, `yad(1)` or something??? idk
 
 multisubstitute {
-       importas -i hostname http_header_parse_Host
+       importas -D -fallback hostname http_header_parse_Host
        importas -i resource resource
 }
 
index 26e6b0c6544499e50c8172dd18f5cd4fe0919ac4..7a0f3f512f719925659d4d8e74ac8ac7735d5e63 100755 (executable)
@@ -175,8 +175,9 @@ ifelse { s6-test \${header_name} = Host }
        #
        ifelse -n { ${supported_hostname_test} ${header_contents} }
        {
-               fdclose 0
-               exit 0
+               heredoc 0 ""
+               export http_header_parse_${header_name} ${header_contents}
+               ${@}
 
        }
        export http_header_parse_${header_name} ${header_contents}