~acdw/bollux

7dd75ca773ce3fcdc4b2dc7d166da6bfb1e8f19f — Case Duckworth a month ago b5e61bc
Handle unknown protocols better (by not handling them)
1 files changed, 5 insertions(+), 6 deletions(-)

M bollux
M bollux => bollux +5 -6
@@ 188,19 188,18 @@ blastoff() { # blastoff [-u] URL
	log d "PROTO='$proto' URL='$url'"

	{
		if declare -Fp "${proto}_request" >/dev/null; then
		if declare -Fp "${proto}_request" &>/dev/null; then
			run "${proto}_request" "$url"
		else
			log d "No request handler for '$proto'; trying gemini"
			run gemini_request "$url"
			die 99 "No request handler for '$proto'!"
		fi
	} | run normalize |
		{
			if declare -Fp "${proto}_response" >/dev/null; then
			if declare -Fp "${proto}_response" &>/dev/null; then
				run "${proto}_response" "$url"
			else
				log d "No response handler for '$proto'; handling raw response"
				raw_response
				log x "No response handler for '$proto', passing through"
				passthru
			fi
		}
}