* fixed (?) proxying redirects
parent
4ce0667870
commit
1ff1d08852
|
@ -6,19 +6,14 @@ if [[ $(grep -Poh "${cfg[proxy_url]}" <<< "$url") == '' ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
host="$(sed -E 's@http(s|)://@@;s@/.*@@' <<< "$url")"
|
host="$(sed -E 's@http(s|)://@@;s@/.*@@' <<< "$url")"
|
||||||
|
proxy_url="$(sed -E 's/\?.*//g' <<< "${r[url]}")"
|
||||||
headers="$(tr '\r' '\n' <<< "${r[req_headers]}")"
|
headers="$(tr '\r' '\n' <<< "${r[req_headers]}")"
|
||||||
headers+=$'\n'
|
headers+=$'\n'
|
||||||
|
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
if [[ "$line" != "GET"* && "$line" != "Host:"* && "$line" != '' ]]; then
|
if [[ "$line" != "GET"* && "$line" != "Host:"* && "$line" != '' ]]; then
|
||||||
params+="-H '$line' "
|
params+="-H '$line' "
|
||||||
fi
|
fi
|
||||||
done <<< "$headers"
|
done <<< "$headers"
|
||||||
|
|
||||||
curl -v --http1.1 "$url" "$params" -D /dev/stdout | grep -aiv "Transfer-Encoding: chunked"
|
curl -v --http1.1 "$url" "$params" -D /dev/stdout | grep -aiv "Transfer-Encoding: chunked" | sed -E 's@Location: @Location: '"$proxy_url"'?'"${cfg[proxy_param]}"'=@'
|
||||||
#if [[ "$url" == "https"* ]]; then
|
|
||||||
#nc $host 443 --ssl -C -i 0.1 --no-shutdown
|
|
||||||
#else
|
|
||||||
#nc $host 80 -C -i 0.1 --no-shutdown
|
|
||||||
#fi
|
|
||||||
|
|
Loading…
Reference in New Issue