Forum Discussion
Editing JSON HTTP Response
Try this:
when HTTP_RESPONSE_DATA {
log local0. "payload before: [HTTP::payload]"
set payload [string map [list "\}\}\}\}" "\}\}"] [HTTP::payload]]
set payload [string map [list "http://" "https://"] [HTTP::payload]]
set payload [string map [list ":80" ""] [HTTP::payload]]
log local0. "payload after: $payload"
HTTP::payload replace 0 $clen $payload $fixeddata1
HTTP::release
}
Tail the LTM log:
tail -f /var/log/ltm
And send a request. This should show you the payload before and after manipulation.
Okay... so this was interesting...
After checking the logs both the before and after payloads did not have the 4 brackets. So somewhere else these are being added...
- Kevin_StewartOct 20, 2022
Employee
Might there be another iRule and/or device in front of this handling HTTP? Or maybe some client side JavaScript that could be modifying the response?
- Chris_BatesOct 21, 2022
Nimbostratus
Yeah, that's what I'm thinking...
I've asked the networking team to take a look. Thanks for the help 🙂
- Leslie_HubertusOct 25, 2022Ret. Employee
Now I'm curious - did they figure out the issue, Chris_Bates?
- Chris_BatesOct 31, 2022
Nimbostratus
Not as of yet. The networking team are adamant that there are no other rules that could affect this despite the logs showing that it's the most likely cause.
We are arranging a meeting this week with F5 to get to the bottom of it hopefully...
Recent Discussions
Related Content
* 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
