* another cookie parsing fix

merge-requests/2/head
Dominika Liberda 2021-01-15 21:15:38 +01:00
parent c02cf1b2ae
commit 062741a66a
1 changed files with 2 additions and 2 deletions

View File

@ -56,8 +56,8 @@ while read param; do
elif [[ "$param" == *"Cookie: "* ]]; then
IFS=';'
for i in $(IFS=' '; echo "$param" | sed -E 's/Cookie: //;;s/%/\\x/g'); do
name="$((grep -Poh ".*?(?==)" | head -1) <<< $i)"
value="$(sed "s/$name=//" <<< $i)"
name="$((grep -Poh "[^ ].*?(?==)" | head -1) <<< $i)"
value="$(sed "s/$name=//;s/^ //;s/ $//" <<< $i)"
cookies[$name]="$(echo -e $value)"
done