webhookd
webhookd copied to clipboard
Log headers
trafficstars
Hey, i am trying to figure out how to log headers.
I know i can call them in a bash script like $user_agent when the header was passed using -H "User-Agent: test-agent/test", but how do i log all of the headers? With the way i described i can only use/output known headers that i have configured in the script, but i would like to see others.
Is it somehow possible to do something equal to the payload using $1?
You can iterate over env variables or call env to print all variables.
while IFS='=' read -r -d '' n v; do
printf "'%s'='%s'\n" "$n" "$v"
done < <(env -0)