Forum Discussion
Abhi_001
Aug 29, 2023Nimbostratus
Help with iRule to mask/hide User Personal Information in HTTP Response
I am trying to create iRule to mask or entirely hide the User Personal Information in HTTP Response Below is the sample HTTP response -: HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Con...
- Aug 29, 2023
Got it solved with below iRule code -:
when HTTP_RESPONSE { set clen [HTTP::header Content-Length] HTTP::collect $clen } when HTTP_RESPONSE_DATA { regsub -all {<PhoneNumber>(.*?)</PhoneNumber>} [HTTP::payload] {<PhoneNumber>********</PhoneNumber>} fixeddata log "Replacing payload with new data." HTTP::payload replace 0 $clen $fixeddata HTTP::release }
Abhi_001
Nimbostratus
Got it solved with below iRule code -:
when HTTP_RESPONSE {
set clen [HTTP::header Content-Length]
HTTP::collect $clen
}
when HTTP_RESPONSE_DATA {
regsub -all {<PhoneNumber>(.*?)</PhoneNumber>} [HTTP::payload] {<PhoneNumber>********</PhoneNumber>} fixeddata
log "Replacing payload with new data."
HTTP::payload replace 0 $clen $fixeddata
HTTP::release
}
Aug 29, 2023
Hi Abhi_001 ,
That's good.
Please mark your answer as an accepted solution , to make it easy for F5 users in all over the world to reach to the solution easly at similar cases 🙂
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