Forum Discussion
Brad_53264
Jun 27, 2012Nimbostratus
Need help to translate line feeds (LF) into carriage returns (CR)
I have a client which is doing an HTTP GET on a plain text file. The plain text file contains line feeds (LF) on every line. I need an iRule solution that translates all line feeds into carriage r...
Brad_53264
Jul 17, 2012Nimbostratus
I've solved this problem using the code below
when HTTP_REQUEST {
set request_method [HTTP::method]
}
when HTTP_RESPONSE {
if { $request_method contains "GET" }{
HTTP::collect [HTTP::header Content-Length]
set clen [HTTP::header Content-Length]
}
}
when HTTP_RESPONSE_DATA {
if { $request_method contains "GET" }{
regsub -all "\n" [HTTP::payload] "\r" newdata
HTTP::payload replace 0 $clen $newdata
HTTP::release
}
}
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