Forum Discussion
sricharan61
Jan 15, 2020Cirrus
I am trying to pick out a string of a decrypted JSON web token to set some paramters in it as variables that i can later use to refer in a custom HTTP header. So, the sample token i have is
I am trying to pick out a string of a decrypted JSON web token to set some paramters in it as variables that i can later use to refer in a custom HTTP header. So, the sample token i have is a...
iaine
Jan 17, 2020Nacreous
Hi
Try something like this....
when HTTP_REQUEST {
if {[HTTP::method] eq "POST"}{
if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= 1048576}{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
if { $content_length > 0} {
HTTP::collect $content_length
}
}
}
when HTTP_REQUEST_DATA {
set payload [HTTP::payload]
set oid [findstr $payload "oid:" 4 " "]
set tid [findstr $payload "tid:" 4 " "]
HTTP::header insert OID $oid
HTTP::header insert TID $tid
log local0. "OID = $oid - TID = $tid"
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects