Forum Discussion
Mark_Cloutier
Feb 04, 2012Nimbostratus
iRule for HTTP 204 response with content-type
Trying to support Google Advanced Search ReportingHere is the irule I have when HTTP_REQUEST { if {[ matchclass [HTTP::uri] starts_with $::http_204_uris] } { HTTP::respond 204 noserverlog local0. "sent 204"}The response being seen is HTTP/1.0 204 No ContentHow can I insert the content-type :image/gif and change the connection value from Keep-Alive to close? I'd alos like to set it to be HTTP/1.1 but the irules reference for HTTP RESPONE makes me this I don't have these options :(
request was to have an http response for a uri starting with /static/img/click that looks like the one that comes from our Google Search appliance which is shown below
HTTP/1.1 204 No Content
Date: Wed, 25 Jan 2012 15:31:30 GMT
Content-Type: image/gif
Content-Length: 0
Connection: close
Connection: Keep-Alive
Content-Length: 0
- nitassEmployeecan you try this?
[root@ve1023:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.19.79:80 ip protocol 6 rules myrule profiles { http {} tcp {} } } [root@ve1023:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[string tolower [HTTP::uri]] starts_with "/static/img/click"} { HTTP::respond 204 noserver "Content-Type" "image/gif" "Connection" "Close" } } } [root@ve1023:Active] config curl -I http://172.28.19.79/static/img/click/test HTTP/1.0 204 No Content Content-Type: image/gif Connection: close Content-Length: 0
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