[QGIS-Developer] [Qgis-psc] Request for Change of UserAgent

Jonathan Moules jonathan-lists at lightpear.com
Sun Feb 24 15:42:59 PST 2019


Interesting thought. But then, what scenario are you imagining? "Mozilla 
5.0" is typically for web-browsers (Richards original point), it doesn't 
seem to be used for most other GIS and tooling (at least when making OGC 
requests).

Examples of other user-agents that I have to hand (somewhat dated):

"ArcGIS Client Using WinInet" - ArcGIS 9.x (but probably 10.x too)

"Tableau 8100.14.0408.1805; pro; libcurl-client; 64-bit; en_US; 
Microsoft Windows 8 Professional (build 9200)"

"FME/2015.7.8.15021  libcurl/7.26.0 OpenSSL/0.9.8a zlib/1.2.7 libidn/1.25"

And I just downloaded gvSIG and uDig:

"uDig 2.0.0. (http://udig.refractions.net) Java/1.8.0_111"

"Mozilla/5.0 (gvSIG) like Gecko"

So it looks like only gvSIG does the Mozilla thing.


On 2019-02-24 23:25, Nyall Dawson wrote:
> On Mon, 25 Feb 2019 at 09:05, Jonathan Moules
> <jonathan-lists at lightpear.com> wrote:
>> This makes sense, but thinking about it, it doesn't seem plausible.
>>
>> If I were whitelisting user agents, there are three ways I'd consider
>> doing it.
>>
>> Explicit full string:
>> * "Mozilla/5.0 QGIS/3.4.3-Madeira" - except of course that'd break next
>> time someone updates QGIS by even a point version. So I doubt anyone is
>> doing that; too much maintenance. And if they *are* doing this, well
>> then they'll have to update their whitelist with the new user agent on
>> the new release whether it includes "Mozilla" or not.
>>
>> * Some sort of regexp looking for that structure (i.e. "Mozilla/5.0
>> QGIS/[0-9].[0-9]...") but allow any set of numbers. I can't conceive of
>> when this would be the best option or even a "good" option - it's just
>> asking for problems with version numbers (what happens when QGIS gets to
>> double-digits in any version field for instance?). I don't doubt it may
>> solve a particular problem somewhere maybe, but I would hope there
>> wouldn't be many using this method (and of course, this is assuming that
>> the "Mozilla" is part of the regex).
>>
>> * Search the user agent for the string "QGIS". I do some things that
>> look at user-agents and this is what I do. It's easily the simplest and
>> definitely the most fool-proof way to validate a client is at least
>> claiming to be QGIS.
> Actually - I'm thinking more of the case where a server doesn't
> know/care about QGIS, and is only allowing requests which begin with
> "Mozilla/5.0".
>
> Nyall




More information about the QGIS-Developer mailing list