Forum Discussion
Russell_E_Glaue
Nimbostratus
Feb 18, 2009The 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
- The_Bhattman
Nimbostratus
It's not a bug. Basically what it does it supresses the insertion of the 'Server: BigIP' header. - spark_86682Historic F5 AccountEDIT: This isn't true; see my next post
- spark_86682Historic F5 AccountOh, 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 }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects