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
"
}
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
"
}
# (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} }
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
"
}