prudent to allow access as an onion service, an `Onion-Location` file
is a good idea. and so on.
+the hostname and requested resource for the current request will be
+substituted for all instances of `${hostname}` and `${resource}` in
+the header contents, which might prove useful for the `Location` and
+`Onion-Location` headers.
+
`\r` and newlines will be stripped from filenames and file contents to
prevent trivial mischevious configurations from breaking HTTP
responses; other than this, **these HTTP header folders are not
# TODO: write a GUI?? with like, `yad(1)` or something??? idk
multisubstitute {
- importas -D -fallback hostname http_header_parse_Host
+ importas -D -no_hostname_parsed hostname http_header_parse_Host
+ importas -i requested_resource http_start_line_parse_resource
importas -i resource resource
}
+define header_substitution_script
+"multisubstitute {
+ define hostname "${hostname}"
+ define resource "${requested_resource}"
+}
+s6-echo -n -- "
backtick -x -n header-directory {
# for status code pages specifically
tr -d "\r\n"
}
if {
- pipeline { cat ${header_name} }
- tr -d "\r\n"
+ backtick -E -n unparsed_header_contents {
+ pipeline { cat ${header_name} }
+ tr -d "\r\n"
+ }
+ execlineb -WPc ${header_substitution_script}${unparsed_header_contents}
}
+
s6-echo -n -- "\r\n"
# do remember to add the terminating `\r\n`!