Forum Discussion

Russell_E_Glaue's avatar
Russell_E_Glaue
Icon for Nimbostratus rankNimbostratus
Feb 18, 2009

The noserver option of HTTP::respond sends back an invalid HTTP format or Content-length

When I use the following code:

 

 
     HTTP::respond 200 content { 
          
         ... 
          
     } 
 

 

 

I get the following back in a web client HTTP request:

 

 
 linux$ telnet 10.0.0.5 80 
 Trying 10.0.0.5... 
 Connected to 10.0.0.5. 
 Escape character is '^]'. 
 GET / HTTP/1.1 
 Host: 10.0.0.5 
  
 HTTP/1.0 200 OK 
 Server: BigIP 
 Connection: Keep-Alive 
 Content-Length: 284 
  
  
          
         ... 
          
         Connection closed by foreign host. 
 linux$  
 

 

 

 

BUT, when I use the "noserver" option as in the following code:

 

 
     HTTP::respond 200 noserver content { 
          
         ... 
          
     } 
 

 

 

I get the following back in a web client HTTP request, which the web browser (tested in firefox and Opera) does not render in the web browser. I assume because the response is in an unexpected format.

 

 
 linux$ telnet 10.0.0.5 80 
 Trying 10.0.0.5... 
 Connected to 10.0.0.5. 
 Escape character is '^]'. 
 GET / HTTP/1.1 
 Host: 10.0.0.5 
  
 HTTP/1.0 200 OK 
 content:  
          
         ... 
          
          
 Connection: Keep-Alive 
 Content-Length: 0 
  
 Connection closed by foreign host. 
 linux$  
 

 

 

Also note, that the Content-Length changes from 284 to 0 - and perhaps this is causing the issue if the HTTP reponse format is actually correct.

 

 

Is this a bug?

 

 

-RG

 

  • It's not a bug. Basically what it does it supresses the insertion of the 'Server: BigIP' header.

     

     

    Click here to read more about it.

     

     

    hope this helps,

     

    CB

     

  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    EDIT: This isn't true; see my next post

     

    I must disagree with cmbhatt; this looks like a bug to me. I would definitely open a case with F5 support on this issue. In the meantime, you should probably use "TCP::respond" as a workaround.
  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    Oh, I figured it out! I was wrong; this is not a bug, it's just that the Wiki page is wrong! The correct way to use "noserver" is to put it after the content, not before. So:

     
     when HTTP_REQUEST { 
       HTTP::respond 200 content { 
            blahblahblah 
       } noserver 
     } 
     

    should work just fine. I'll update the Wiki....