TCL Error on replacing strings
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" "/"
}