]> cat aescling's git repositories - httpd-execline.git/commitdiff
bugfix: unbreak response when no extra headers
authorsingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Tue, 24 Aug 2021 04:26:52 +0000 (04:26 +0000)
committersingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Fri, 27 Aug 2021 15:07:13 +0000 (11:07 -0400)
visible-to-httpd/binaries/http-error-response.execline
visible-to-httpd/binaries/http-get-extra-headers.execline
visible-to-httpd/binaries/httpd.execline

index d0e704f9fe78b8a0a54fe9c21c70be796d0bf6e6..08805667338d7c2c46259469c489892d5c1c8a65 100755 (executable)
@@ -56,8 +56,7 @@ if {
                        s6-echo -n -- "HTTP/1.1 "${1}" "${2}"\r
 Content-Type: "${Content-Type}"\r
 Content-Length: "${Content-Length}"\r
-Date: "${Date}"\r
-"${extra_headers}"
+Date: "${Date}${extra_headers}"
 \r
 "
                }
@@ -81,8 +80,7 @@ Date: "${Date}"\r
                        s6-echo -n -- "HTTP/1.1 "${1}" "${2}"\r
 Content-Type: application/xhtml+xml; charset=utf-8\r
 Content-Length: "${Content-Length}"\r
-Date: "${Date}"\r
-"${extra_headers}"
+Date: "${Date}${extra_headers}"
 \r
 "
                }
index 45b56c3889bd7cd849c9de86cced8dd409323dcf..0bee83194a71899fdf67e8c3ad54c2ceb7b9f659 100755 (executable)
@@ -63,6 +63,9 @@ backtick -x -n header-directory {
 
 # (we output nothing if there is no applicable header directory, which is fine)
 if -t { s6-test -v header-directory }
+       # to avoid double \r\n in case we don't output anything
+       if { s6-echo -n -- "\r\n" }
+
        importas -i -u header-directory header-directory
 
        foreground { log.execline "header-directory: "${header-directory} }
index e04807a01dbe92b8f6c7e628ce476e2686d3df3c..85903ea332fb788c3b3eecdb099a35ca8575b72a 100755 (executable)
@@ -236,8 +236,7 @@ if -X -n -t {
 Content-Type: "${Content-Type}"\r
 Content-Length: "${Content-Length}"\r
 Last-Modified: "${Last-Modified}"\r
-Date: "${Date}"\r
-"${extra_headers}"
+Date: "${Date}${extra_headers}"
 \r
 "
        }