Forum Discussion
Expect: 100-continue header and Big-IP 100 responses
We've tried something like this:
if { [HTTP::header exists "Expect"] } {
HTTP::header remove "Expect"
HTTP::respond 100
}
but it seems that the HTTP::respond correctly provides the response to the client, the client continues with the request, but Big-IP does not forward anything to the server (which is this case is a proxy server).
Anyone encountered something similar ? Any help would be appreciated.
Description of "Expect: 100 continue" header is available:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
- bl0ndie_127134Historic F5 AccountYes, the respond rule makes BigIP act as the web server so the requests does not get sent to the back end server. Try this version of the rule instead.
if {([HTTP::method] == “POST”) && [HTTP::header exists "Expect"] } { HTTP::header remove "Expect" TCP::respond “HTTP/1.1 100 Continue\r\n\r\n” }
- George_Dimitria
Nimbostratus
Many Thanks !!!! It seems to work. - Jason_Jernigan1
Nimbostratus
I have run into a similar situation as above. However I'm trying to do this while using HTTPS and the - Colin_Walker_12Historic F5 AccountThere isn't currently a way via iRules to specifically deal with SSL connections using TCP events and commands.
- Sam_Parkes_1110
Nimbostratus
I just wanted to let you know that there is a way of doing this now, but wanted to share the code below as it covers all 3 scenarios I've found where clients use the Expect 100-continue request header. 1) Some clients send the Expect 100 continue header but also send the payload at the same time. 2) Some clients send the Expect 100 continue header and will wait for us to reply with 100 Continue before sending the XML payload. 3) Clients who don't use it at all.
The rule below will check if there is any payload when the headers are received in the HTTP_REQUEST event before deciding if we should reply with a 100 Continue response or not.
This is the only way I could get this working but would be happy to hear if it can be done in a better/cleaner way.
when HTTP_REQUEST { if { ([HTTP::uri] equals "UrlYouAreInterestedIn") and ([HTTP::method] equals "POST") } { set flag 1 } Has the client sent the payload yet? if $flag { set nocontent 1 HTTP::collect 10 log [HTTP::payload 10] if { [HTTP::payload 10] contains "<" } { set nocontent 0 HTTP::header remove "Expect" log "$nocontent value" } } TCP/SSL respond if Expect header is sent in order to allow continuation of payload streaming Replace SSL::respond with TCP::respond for non SSL Virtual Server if $nocontent { if { ([HTTP::header exists "Expect"]) and ([HTTP::method] equals "POST") } { HTTP::header remove "Expect" SSL::respond "HTTP/1.1 100 Continue\r\n\r\n" } } Note This event will NOT fire if "Expect: 100-continue Header" is present so we remove it in above rule sections. when XML_CONTENT_BASED_ROUTING { if $flag { for {set i 0} { $i < $XML_count } {incr i} { if { [class match $XML_values($i) equals my_datagroup] } { pool my_pool } } } }
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