[Mapserver-users] WMS using libCurl fails because of a wrong HTTP User Agent

Daniel Morissette morissette at dmsolutions.ca
Wed Sep 24 15:07:49 EDT 2003


Norbert Schauerte-Lueke wrote:
> 
> still there is a problem with the UMN wms-client and a propritary WMS 
> Server. The diagnostic of the problem show that the WMS Client will 
> only send an image when the HTTP User Agent will be MSIE or 
> Mozilla. libCurl sets an other HTTP User Agent (somethink like CURL 
> Version ...). Is there a possibility to change this HTTP User Agent e.g. 
> via an environment variable.
> 
> If anybody can give a hint, I will be very thankfull
> 

I find it really odd that a WMS server would cehck the user agents 
before responding to client requests, but anyway, there is apparently a 
way to control the user agent value with Libcurl.  If you can build from 
source, then you could add the following line to maphttp.c around line 
339, just after the line that sets CURLOPT_URL:

   curl_easy_setopt(http_handle, CURLOPT_USERAGENT, "whatever you want");

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               morissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-users mailing list