* even better sanitization in proxy
parent
988e290eed
commit
d249f225ba
|
@ -9,11 +9,14 @@ host="$(sed -E 's@http(s|)://@@;s@/.*@@' <<< "$url")"
|
||||||
proxy_url="$(sed -E 's/\?.*//g' <<< "${r[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'
|
||||||
|
#params=()
|
||||||
|
|
||||||
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' "
|
args+=('-H')
|
||||||
|
args+=("$line")
|
||||||
fi
|
fi
|
||||||
done <<< "$headers"
|
done <<< "$headers"
|
||||||
|
|
||||||
curl -v --http1.1 "$url" "$params" -D /dev/stdout | grep -aiv "Transfer-Encoding: chunked" | sed -E '/Location/s/\?/%3f/g;/Location/s/\&/%26/g;s@Location: @Location: '"$proxy_url"'?'"${cfg[proxy_param]}"'=@'
|
curl --http1.1 "$url" "${args[@]}" -D /dev/stdout | grep -aiv "Transfer-Encoding: chunked" | sed -E '/Location/s/\?/%3f/g;/Location/s/\&/%26/g;/Location/s/\:/%3a/g;/Location/s@/@%2f@g;s@Location%3a @Location: '"$proxy_url"'?'"${cfg[proxy_param]}"'=@'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue