Greetings -

I recently had a user complain that when they would type a search term (like dell 
instead of www.dell.com) in their address bar that squid would return an error page 
stating that it was an invalid URL instead of IE going to the MSN search page. Upon 
further investigation I found that IE will only return the search page if the proxy 
server sends a 502 - bad gateway error, but not a 503 - service unavailable error (the 
default squid behavior).

To correct this I modified forward.c and changed the following:

err = errorCon(ERR_DNS_FAIL, HTTP_SERVICE_UNAVAILABLE);

to

err = errorCon(ERR_DNS_FAIL, HTTP_BAD_GATEWAY);

IE will now go to the search page if a user enters an invalid hostname in the URL (and 
has the search functionality enabled). I'm not sure if this change will ever make it 
into the squid stable branch but it's worth noting that most commercial proxy servers 
return a 502 error in this situation.

Thanks,
David

Reply via email to