* fixes problems with %3F in GET query

merge-requests/2/head
Dominika Liberda 2021-06-01 00:52:43 +02:00
parent 1bc1fc3127
commit b92dc47b38
1 changed files with 2 additions and 4 deletions

View File

@ -77,9 +77,8 @@ while read -r param; do
elif [[ "$param" == *"GET "* ]]; then
r[url]="$(echo -ne "$(url_decode "$(sed -E 's/GET //;s/HTTP\/[0-9]+\.[0-9]+//;s/ //g;s/\/*\r//g;s/\/\/*/\//g' <<< "$param")")")"
data="$(sed -E 's/\?/<2F><>MaE_iS_CuTe<EFBFBD>/;s/^(.*)<29><>MaE_iS_CuTe<EFBFBD>//;s/\&/ /g' <<< "${r[url]}")"
data="$(sed -E 's/\?/<2F><>Lun4_iS_CuTe<EFBFBD>/;s/^(.*)<29><>Lun4_iS_CuTe<EFBFBD>//;s/\&/ /g' <<< "${r[url]}")"
if [[ "$data" != "${r[url]}" ]]; then
data="$(echo ${r[url]} | sed -E 's/^(.*)\?//')"
IFS='&'
for i in $data; do
name="$(sed -E 's/\=(.*)$//' <<< "$i")"
@ -92,9 +91,8 @@ while read -r param; do
r[url]="$(echo -ne "$(url_decode "$(sed -E 's/POST //;s/HTTP\/[0-9]+\.[0-9]+//;s/ //g;s/\/*\r//g;s/\/\/*/\//g' <<< "$param")")")"
r[post]=true
# below shamelessly copied from GET, should be moved to a function
data="$(sed -E 's/\?/<2F><>MaE_iS_CuTe<EFBFBD>/;s/^(.*)<29><>MaE_iS_CuTe<EFBFBD>//;s/\&/ /g' <<< "${r[url]}")"
data="$(sed -E 's/\?/<2F><>Lun4_iS_CuTe<EFBFBD>/;s/^(.*)<29><>Lun4_iS_CuTe<EFBFBD>//;s/\&/ /g' <<< "${r[url]}")"
if [[ "$data" != "${r[url]}" ]]; then
data="$(sed -E 's/^(.*)\?//' <<< "${r[url]}")"
IFS='&'
for i in $data; do
name="$(sed -E 's/\=(.*)$//' <<< "$i")"