Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We've got a website which has been running for a few years now. One of our customers has just started having an intermittent problem. Looking at our iis6.0 logs the service works correctly when they have a user agent beginning "mozilla/4.0+" but fails when the user agent begins "mozilla/5.0+". The particular customer only started having this problem on Wednesday.

Does anyone know the browser/upgrade which changes the 4.0 to 5.0?

The actual problem caused is that an "&" in a url parameter list is being encoded as "&". Anyone seen anything similar?

We have other users sending from browsers with the 5.0+ user agent without trouble.

Sorry about the tags but don't have the rep to create new ones.

Thanks in advance, Patrick

Edit: hi Viper_sb,

It is most probably a custom script (I'm primarily a c++ developer so don't really understand). Our site services requests from other customer developed sites, this one was done in Java script as far as I know.

we're actually getting a variety of user agents (presumably depending on which of our customers customers is accessing the service), here's a few:

Mozilla/5.0+(Windows;+U;+Windows+NT+6.1;+fr;+rv:1.9.1.11)+Gecko/20100701+Firefox/3.5.11
Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US)+AppleWebKit/533.4+(KHTML,+like+Gecko)+Chrome/5.0.375.126+Safari/533.4 302 0 0
Mozilla/5.0+(Macintosh;+U;+PPC+Mac+OS+X;+fr)+AppleWebKit/523.12+(KHTML,+like+Gecko)+Version/3.0.4+Safari/523.12
Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.9.2.8)+Gecko/20100722+Firefox/3.6.8
Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+fr;+rv:1.9.2.8)+Gecko/20100722+Firefox/3.6.8+(.NET+CLR+3.5.30729)
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Firefox 3.x and many others do.

Can you post the full agent string that you're having problems with? As it sounds like it could be a custom script that is generating the request and pretending to be a certain agent. But is incorrectly creating the ident string. Or your check against the agent string is incorrect.

Edit: The strings you posted are being url-encoded the +'s in them should be spaces. I'm not sure where the problem is, if it's on your javascript side or in the user visiting the site.

I'm going to go out here and guess that your javascript is decoding the agent string, this shouldn't happen (unless you're going to make a url out of it or post it on your web site).

share|improve this answer

I'm guessing the + in the UA strings is because of the way IIS logs it.

Just to clarify, are you saying that you have query strings in links on the site and that some UAs are making requests for those URLs but using & instead of &?

If that's the case then the most likely cause is an exceedingly stupid bot that is spoofing its UA string. Any properly written HTML should encode the & in the URL as &. A proper browser and a sensible bot have been made correctly and know that you mean http://example.com/?a=1&b=2 when you link to /?a=1&b=2 in your source code. Taking any other href literally doesn't show issues, but taking those ones literally would show the behaviour that I think you're describing.

I get all sorts of requests for pages that don't exist where they're requested, but do exist elsewhere, and it is normally because the bot wasn't able to handle such things as base paths (not my doing - OpenCart uses them for some reason) or absolute URLs or URLs on other hosts (it takes the path part but not the host).

One good indicator tends be to running a rDNS lookup on the IP. If one or more of them resolve back to a web host then someone is running a bot/dumb script.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.