-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: misc action: commit revision: path_from: revision_from: 8b1c2f7e40f9c7ae77d3afb9f3eec21886c8f060: path_to: revision_to:
commit 8b1c2f7e40f9c7ae77d3afb9f3eec21886c8f060 Author: Epoch Qwert <epoch@53flpnlls43fcguy.onion> Date: Sun Nov 23 14:35:17 2014 -0600 noticed mime-type, which is used by httpd, wasn't included. diff --git a/nocompile/bin/mime-type b/nocompile/bin/mime-type new file mode 100755 index 0000000000000000000000000000000000000000..71982d923e232ae0ea65e8a4234ae3b6611072e6 --- /dev/null +++ b/nocompile/bin/mime-type @@ -0,0 +1,13 @@ +#!/bin/sh +TYPE="$(file -b --mime-type $1)" +MAIN="$(echo "${TYPE}" | cut -d/ -f1)" +SUB="$(echo "${TYPE}" | cut -d/ -f2)" +if [ "_${MAIN}" = "_inode" ];then + printf "text/plain\r\n" + printf "this is a directory or symlink! wtf?!?" + TYPE="text/plain" +fi +if [ "_${MAIN}" = "_text" -a "_${SUB}" != "_html"];then + TYPE="text/plain" +fi +printf "%s\r\n" "$TYPE"
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 15:38:31 2024