Forum Discussion
Expect: 100-continue header and Big-IP 100 responses
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