Commit d249f225 authored by Dominika Liberda's avatar Dominika Liberda 💽
Browse files

* even better sanitization in proxy

parent 988e290e
Pipeline #404 failed with stage
in 14 seconds
......@@ -9,11 +9,14 @@ host="$(sed -E 's@http(s|)://@@;s@/.*@@' <<< "$url")"
proxy_url="$(sed -E 's/\?.*//g' <<< "${r[url]}")"
headers="$(tr '\r' '\n' <<< "${r[req_headers]}")"
headers+=$'\n'
#params=()
while read line; do
if [[ "$line" != "GET"* && "$line" != "Host:"* && "$line" != '' ]]; then
params+="-H '$line' "
args+=('-H')
args+=("$line")
fi
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]}"'=@'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment