astro

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit f59d042839650fcd96ae6215b357bb343c9be81e
parent d3897d490bc13fb28d8db62f78290875c8e48bd0
Author: René Wagner <rwa@clttr.info>
Date:   Wed, 22 Dec 2021 21:12:54 +0100

fix relative redirects

as per spec redirects can be absolute or relative.
In order to handle relative redirects correctly we need
to apply the some logic as to relative URIs.

Diffstat:
Mastro | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/astro b/astro @@ -139,7 +139,10 @@ fetch() { # Redirect [ "$debug" ] && echo "Redirect to: $meta" >&2 # shellcheck disable=SC2046 - fetch $(parseurl "$meta") + read -r proto host port path << EOF + $(oldhost="$2" oldpath="$4" parseurl "$meta") +EOF + fetch "$proto" "$host" "$port" "$path" return 0 ;; 40)