This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I don't know if this is the proper place to ask this type of question so please forgive me... Why is it that the User-Agent HTTP header value is alway set to Mozilla/4.0 when Mozilla is not being used to generate the request? For instance I am using MSIE 6.0 to make a request and the User-Agent in the request header is set to:
I'm sure there is some sort of historical explination for this but of course I can't find it on the net so I am hope somone here can educate me. Thanks, Jamin
Since this is more of a browser question than a JSP question, I'm going to shuffle this off to the HTML forum. But the short answer is that there is no standard for the User-Agent header so browsers can do whatever they want. And that makes it a, er, 'challange' to decipher in a deterministic manner.
Hi Jamin try go to this w3schools link using IE6 and see the magic It shows Netscape 4.0!!! So as suggested earlier it seems that due to non-standardization of this browser string for User-Agent header makes our life difficult. But a possible work around could be, - Detect if its a mozilla,netscape browser. I have so far not seen that Mozilla/netscape browsers returning incorrect information (e.g. MSIE6 as the browser type) - and if (!netscape || !mozilla || !other_browser) then assume its IE..
this might work for you.. Regards Maulin
Joined: Dec 16, 2003
Thanks for the tip Maulin. I guess if I want to go that route I need to find out what the other browers return... If anyone knows the answer to the original question, please feel free to share it! Jamin