commit 80cbcaf4a52723d1e0d37a23bf91fbcc774467e1
parent 3f744833da4253f1ae2074262b97beaf8fd249ff
Author: René Wagner <rwa@clttr.info>
Date: Wed, 16 Aug 2023 20:58:32 +0200
omit port in request URI when it's the default of 1965
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/astro b/astro
@@ -1,6 +1,6 @@
#!/bin/sh
-version="0.21.0"
+version="0.22.4"
usage() {
echo "astro v$version: Browse the gemini web on the terminal."
@@ -282,10 +282,12 @@ EOF
debug "using client cert for domain: $certfile"
fi
- [ "$trace" ] && echo "url: $1://$2:$3/$4$5" >> "$tracefile"
+ port=$( [ "$3" = "1965" ] || ":$3" )
+ url="$1://$2$port/$4$5"
+ [ "$trace" ] && echo "url: $url" >> "$tracefile"
stop
- echo "$1://$2:$3/$4$5" | eval openssl s_client \
+ echo "$url" | eval openssl s_client \
-connect "$2:$3" "$certfile" -crlf -quiet \
-ign_eof 2> /dev/null > "$pagefile"
stop "openssl fetch"