Forum Discussion

dheywood_22484's avatar
dheywood_22484
Icon for Nimbostratus rankNimbostratus
Aug 01, 2014

wpad.dat irule for F5

I've got a problem with an iRule, I've got a rule thats working:

when HTTP_REQUEST {
 Send the wpad.dat content
HTTP::respond 200 content {\
return "DIRECT";}
}

Now I need to add the Content-Type"application/x-ns-proxy-autoconfig" to it, how would I edit the irule, I've got:

when HTTP_REQUEST {
 Send the wpad.dat content
HTTP::respond 200 "Content-Type" "application/x-ns-proxy-autoconfig" content {\
return "DIRECT";}
}

but its not returning any content in the file but the header is set

  • when HTTP_REQUEST {
     Send the wpad.dat content
    HTTP::respond 200 content {\
    return "DIRECT";} "Content-Type" "application/x-ns-proxy-autoconfig" 
    }
    

    Any parameters following content are considered header and its value pairs. These are added as headers into the web response.

    HTTP::respond 200 content "your html" header value header value ...