about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-06-08 15:56:45 -0500
committerCase Duckworth2020-06-08 15:56:45 -0500
commit7dd75ca773ce3fcdc4b2dc7d166da6bfb1e8f19f (patch)
treeb4641bc2524bdb33f425599e88b8341fa062c025
parentReload page if no links (diff)
downloadbollux-7dd75ca773ce3fcdc4b2dc7d166da6bfb1e8f19f.tar.gz
bollux-7dd75ca773ce3fcdc4b2dc7d166da6bfb1e8f19f.zip
Handle unknown protocols better (by not handling them)
-rwxr-xr-xbollux11
1 files 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
188 log d "PROTO='$proto' URL='$url'" 188 log d "PROTO='$proto' URL='$url'"
189 189
190 { 190 {
191 if declare -Fp "${proto}_request" >/dev/null; then 191 if declare -Fp "${proto}_request" &>/dev/null; then
192 run "${proto}_request" "$url" 192 run "${proto}_request" "$url"
193 else 193 else
194 log d "No request handler for '$proto'; trying gemini" 194 die 99 "No request handler for '$proto'!"
195 run gemini_request "$url"
196 fi 195 fi
197 } | run normalize | 196 } | run normalize |
198 { 197 {
199 if declare -Fp "${proto}_response" >/dev/null; then 198 if declare -Fp "${proto}_response" &>/dev/null; then
200 run "${proto}_response" "$url" 199 run "${proto}_response" "$url"
201 else 200 else
202 log d "No response handler for '$proto'; handling raw response" 201 log x "No response handler for '$proto', passing through"
203 raw_response 202 passthru
204 fi 203 fi
205 } 204 }
206} 205}