]> cat aescling's git repositories - httpd-execline.git/commitdiff
http-error-response.execline: cleanup
authorsingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Thu, 26 Aug 2021 02:44:46 +0000 (22:44 -0400)
committersingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Fri, 27 Aug 2021 15:08:04 +0000 (11:08 -0400)
visible-to-httpd/binaries/http-error-response.execline

index 08805667338d7c2c46259469c489892d5c1c8a65..7add6c12b996dd6112a20261438fe2560d3c9773 100755 (executable)
@@ -45,7 +45,7 @@ if {
                cd ${error_response_directory}
 
                backtick -D "application/xhtml+xml; charset=utf-8" -n Content-Type { cat Content-Type }
-               backtick -i -n Content-Length { wc -c message_body }
+               backtick -i -n Content-Length { stat -c %s -- message_body }
 
                multisubstitute {
                        importas -i -u Content-Type Content-Type
@@ -66,11 +66,10 @@ Date: "${Date}${extra_headers}"
 
                # (why does `hoc -e` not work?)
                backtick -n -E Content-Length {
-                       backtick -i -n message_length {
+                       backtick -E -i -n message_length {
                                pipeline { s6-echo -n -- ${2} }
                                wc -c
                        }
-                       importas -i -u message_length message_length
 
                        pipeline { s6-echo -- ${message_length}"*2 + 288" }
                        hoc