Forum Discussion

George_Dimitria's avatar
George_Dimitria
Icon for Nimbostratus rankNimbostratus
Jan 12, 2006

Expect: 100-continue header and Big-IP 100 responses

Is it possible for Big-IP (v.9.1.1) to supply the 100-continue header when it reeives a "Expect: 100-continue" header from a client (RFC2616) ?

 

 

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

 

5 Replies

  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    Yes, 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.

    Just keep in mind that we have seen servers that send unsolicited '100' responses.

    
    if {([HTTP::method] == “POST”) && [HTTP::header exists "Expect"] } {
       HTTP::header remove "Expect"
       TCP::respond “HTTP/1.1 100 Continue\r\n\r\n”
    }

  • I have run into a similar situation as above. However I'm trying to do this while using HTTPS and the

     

    TCP::respond command will not work since it will send the response in plain text. Is there a way to accomplish this when using HTTPS?

     

    Thanks,

     

    Jason
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    There isn't currently a way via iRules to specifically deal with SSL connections using TCP events and commands.

     

     

    This is something that's being looked into for a future release, but there is currently no definitive date set as far as I know.

     

     

    This was discussed some time ago in regards to reading TCP packet information when encrypted. You can read the old thread here: Click here

     

     

    Colin
  • 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 }
        }
    }
    }