Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change javascript content from server response

Ben_D
Nimbostratus
Nimbostratus

Hello, 

I've an issue one of our apps call an external services across F5 BIG-IP, response is an javascript download on client browser. 

I would like to modify the content ( change fqdn ) of this javascript : irule, iruleLX or LTM policy. 

Do you know how can i do this ? 

I try with stream but it seems not work. 

best regards

 

1 REPLY 1

Can you share the irule/stream profile?

Because with an irule it should work:

when HTTP_REQUEST {
 # Disable the stream filter for client requests
   STREAM::disable
   HTTP::header remove Accept-Encoding
}

when HTTP_RESPONSE {
 # Disable the stream filter for server responses
 STREAM::disable
 # Enable the stream filter for text responses only
 if {([HTTP::status] == 200)} {
  # Replace 'example.com' with 'app.example.com'
  STREAM::expression {@example.com@app.example.com@}
  # Enable the stream filter
  STREAM::enable
 }
}

Cheers,
Kees