Forum Discussion

Youssef_Ghorbal's avatar
Sep 19, 2016
Solved

APM Portal Access broken links

Hello,

I'm having an issue accessing some links of a website when using Portal Access. I tracked down the problem to the fact that the website I'm trying to access to generates "broken" URLs, for example :

https://login.incites.thomsonreuters.com?DestApp=IC2&wsid=Z1I4eYdJZKMFpaWeaM1

Please note the missing "/" between the end of the host section and the beginning of the query string. The correct URL should be :

https://login.incites.thomsonreuters.com/?DestApp=IC2&wsid=Z1I4eYdJZKMFpaWeaM1

Most of the web browsers I tested detect those and correct them before sending the request. Even, curl does that :

 

$ curl -v "https://login.incites.thomsonreuters.com?DestApp=IC2&wsid=Z1I4eYdJZKMFpaWeaM1"
* Rebuilt URL to: https://login.incites.thomsonreuters.com/?DestApp=IC2&wsid=Z1I4eYdJZKMFpaWeaM1
[...]

 

Sadly, The APM HTTP client used for Portal Access requests does not perform that kind of auto correction. When the page is requested, the server responds (rightfully) with an HTTP 400 bad request.

  • Is there any way to make BigIP do this obvious auto correction ?
  • Is there any workaround via un iRule for example ? (sure I can try to contact the website owners, but it will take ages to convince them to correct their code)

Any advice ?

Youssef Ghorbal

  • Yes you can do it easily with an irule like. Should be many examples on the irules wiki

     

    when HTTP_REQUEST {
      if { [HTTP::uri] eq "blahblahblah" } {
        HTTP::uri "set it to the correct thing"
      }
    }
    

     

2 Replies

  • Josiah_39459's avatar
    Josiah_39459
    Historic F5 Account

    Yes you can do it easily with an irule like. Should be many examples on the irules wiki

     

    when HTTP_REQUEST {
      if { [HTTP::uri] eq "blahblahblah" } {
        HTTP::uri "set it to the correct thing"
      }
    }
    

     

    • Youssef_Ghorbal's avatar
      Youssef_Ghorbal
      Icon for Cirrus rankCirrus

      You put me on the right track. I ended up using the REWRITE_REQUEST_DONE event since the HTTP_REQUEST is client side (and only deals with APM hashed URIs)

      The iRule looks like :

       

      when REWRITE_REQUEST_DONE {
          if { [HTTP::uri] starts_with "?" } {
          HTTP::uri /[HTTP::uri]
        }
      }