Forum Discussion

karthik_sriniva's avatar
karthik_sriniva
Icon for Nimbostratus rankNimbostratus
Oct 28, 2005

Stream Profile: Replace String

Hi Guys,

 

I had configured a virtual server for our secure site. The content is legacy code and it has hardcoded urls for http. Currently I am using stream profile to replace all the http:// to https://

 

 

The code also contains javascript which has hardcoded http%3A%2F%2F, which should be replaced with https%3A%2F%2F. Is there a way to make stream profile perform this replacement as well.

 

 

Thanks for your help as always

 

Srini

23 Replies

  • Yep, the ProxyPass iRule is quite the tool--but it's not always necessary to have all of that overhead for simpler scenarios.

     

     

    Aaron
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    I'm not sure I follow what you're asking for. HTTP::host currently works.

     

     

    Colin
  • Hi Colin,

    HTTP::host is an allowed command in HTTP_RESPONSE per the wiki, and the iRule validation allows it, but on 10.0.1 it doesn't seem to work:

     
     when HTTP_REQUEST { 
        log local0. "[IP::client_addr]:[TCP::client_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri]" 
     } 
     when HTTP_RESPONSE { 
        log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::status] response ([HTTP::host])" 
     } 
     

    : 172.31.42.11:2467: New GET request to 10.42.15.20:8080/

    : 172.31.42.11:2467: 200 response ()

    So I was suggesting that Hamish save the HTTP::host value from HTTP_REQUEST and reference the variable in HTTP_RESPONSE.

    Aaron