From 7dd75ca773ce3fcdc4b2dc7d166da6bfb1e8f19f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 8 Jun 2020 15:56:45 -0500 Subject: Handle unknown protocols better (by not handling them) --- bollux | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bollux b/bollux index ed84894..8f6b596 100755 --- a/bollux +++ b/bollux @@ -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 } } -- cgit 1.4.1-21-gabe81