Forum Discussion
HTTP content rewrite iRule
The error is:
011f0007:3:
http_process_state_early_100continue - Invalid action EV_COLLECT
I'm pretty sure the issue is somewhere around this line:
if { $content_len > 0 && [HTTP::status] != 100 } {
Not sure why it's even running a collect if the http status is 100...
when HTTP_REQUEST {
set usentlm 0
if { ([HTTP::uri] starts_with "/sso/autodiscover/") } {
log "OWA Rewrite for autodiscover SSO engaged"
set usentlm 1
HTTP::uri [string map { /sso/autodiscover/ /autodiscover/ } [HTTP::uri]]
HTTP::uri "/autodiscover/autodiscover.xml"
Don't allow data to be chunked.
if {[HTTP::version] == "1.1"} {
if {[HTTP::header is_keepalive]} {
Adjust the Connection header.
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
}
when HTTP_RESPONSE {
if { $usentlm equals 1 } {
if {[HTTP::header exists "Content-Length"]} {
set content_len [HTTP::header "Content-Length"]
} else {
set content_len 4294967295
}
if { $content_len > 0 && [HTTP::status] != 100 } {
HTTP::collect $content_len
}
}
}
when HTTP_RESPONSE_DATA {
if { $usentlm equals 1 } {
set payload [HTTP::payload]
set length [HTTP::payload length]
set new_payload [string map {Basic Ntlm} $payload]
if { $new_payload ne $payload } {
Replace the content if there was any matches
log "SSO Autodiscover rule applied"
HTTP::payload replace 0 $length $new_payload
}
}
}
- hooleylistCirrostratusHi Mike,
when HTTP_REQUEST { Log debug to /var/log/ltm? 1=yes, 0=no. set stream_debug 1 Disable the stream filter by default STREAM::disable set usentlm 0 if { ([HTTP::uri] starts_with "/sso/autodiscover/") } { log "OWA Rewrite for autodiscover SSO engaged" set usentlm 1 HTTP::uri [string map { /sso/autodiscover/ /autodiscover/ } [HTTP::uri]] HTTP::uri "/autodiscover/autodiscover.xml" if {$stream_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Rewrote [HTTP::uri] to\ [string map { /sso/autodiscover/ /autodiscover/ } [HTTP::uri]]"} Don't allow data to be chunked. if {[HTTP::version] == "1.1"} { if {[HTTP::header is_keepalive]} { Adjust the Connection header. HTTP::header replace "Connection" "Keep-Alive" } HTTP::version "1.0" } } } when HTTP_RESPONSE { if { $usentlm == 1 } { if {[HTTP::header "Content-Type"] starts_with "text/"} { if {$stream_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Enabling stream for [HTTP::header "Content-Type"]"} STREAM::expression {@[bB]asic@Ntlm@} STREAM::enable } else { if {$stream_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Disabling stream for [HTTP::header "Content-Type"]"} STREAM::disable } } } when STREAM_MATCHED { Debug only. Comment out or remove when testing is complete if {$stream_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: matched: [STREAM::match]"} }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com