cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

TCL Error on replacing strings

Livius
Altostratus
Altostratus

Hi everyone,

 

Trying to understand what might be the issue with replacing content with regsub, getting following error :

 

<HTTP_REQUEST> - ERR_ARG (line 2)    invoked from within "HTTP::uri [regsub "/3dnotification" [HTTP::uri] ""] "

 

I might replace the regsub with other operand doing the same operation.

 

The iRule code is the following :

 

 

   if { not ( [string tolower [HTTP::uri]] starts_with "/socket.io" )} then {

      HTTP::uri [regsub "/3dnotification" [HTTP::uri] ""]

      # need to strip trailing slash on URI otherwise results in 404 for resources...

      HTTP::uri [regsub "\/$" [HTTP::uri] ""]

   } elseif { [string tolower [HTTP::header Upgrade]] contains "websocket" } {

      ONECONNECT::reuse disable

      set oc_reuse_disable 1

   }

   HTTP::header replace "X-Forwarded-ContextPath" "/"

}

 

 

1 REPLY 1

Hello Livius.

 

Does the error raise on each query or just with some of them?

 

I'm suppecting that some specific URI structure could cause this issue.

Take into account that someone could create some crafted URI that could cause some kind of injection (intencionally or not).

 

Could you give us some feedback of which specific URI could cause the issue and which one not?

 

Regards,

Dario.

Regards,
Dario.