Forum Discussion

sirad_85122's avatar
sirad_85122
Icon for Nimbostratus rankNimbostratus
Apr 08, 2010

Two Connection: close in HTTP response header.

Hi guys,

 

I have problem with HTTP::respond method. My I rule looks like:

 

 

when HTTP_REQUEST {

 

set uri [HTTP::uri]

 

if { not ($uri starts_with "http") } {

 

set uri "http://$uri"

 

}

 

set method [HTTP::method]

 

set host [URI::host $uri]

 

set port [URI::port $uri]

 

 

 

if { [matchclass [string tolower $host] contains $::proxy_uri] } {

 

HTTP::respond 302 Location $uri "Connection" "close"

 

 

}

 

}

 

 

but, I'm receiving in response:

 

 

HTTP/1.0 302 Found

 

Location: http://counter.softline.com.pl/

 

Connection: close

 

Server: BigIP

 

Connection: close

 

 

"Connection: close" header exists twice in HTTP header response. I'd like browser to reopen new TCP connection to server. When I use " HTTP::respond 302 Location $uri" get "Connection: Keep-Alive" in response.

 

 

I'm using BIGIP 9.3.1

 

 

Is it a bug or I'm doing something wrong?

 

Thanks for any advice.

 

Adam

 

 

 

 

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Adam,

    Can you try this:

    
          HTTP::respond 302 Location $uri
          TCP::close
    

    Aaron
  • J_C_13164's avatar
    J_C_13164
    Historic F5 Account
    There does appear to be some oddness with HTTP::respond and the headers in 9.3.1, though this works as expected in 9.4.8.

    I would recommend using a TCP::respond in this case. :

    TCP::respond "HTTP/1.1 302 Found\r\nLocation: $uri\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    This is actually described in SOL8960:

     

     

    SOL8960: The HTTP::respond iRule command sends double Connection headers in the HTTP response

     

    https://support.f5.com/kb/en-us/solutions/public/8000/900/sol8960.html

     

     

    Aaron