webhookd icon indicating copy to clipboard operation
webhookd copied to clipboard

Log headers

Open Joly0 opened this issue 7 months ago • 1 comments
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?

Joly0 avatar Apr 10 '25 09:04 Joly0

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)

ncarlier avatar Apr 10 '25 19:04 ncarlier