User-Agent in WMS client

Eijnden, B. van den (Bart) b.vdeijnden at AGI.RWS.MINVENW.NL
Thu Apr 13 10:23:04 EDT 2006


Hi list,

the WMS client code of Mapserver does not set the User-Agent in the http
headers, and we have encountered some Apache webservers which throw an
internal server error when there is no User-Agent set. We have successfully
patched our maphttp.c with the change below and this seems to work. Would it
be a good idea to apply this patch (or a similar patch) in Mapserver's
source code?

        /* set URL, note that curl keeps only a ref to our string buffer */
        curl_easy_setopt(http_handle, CURLOPT_URL, pasReqInfo[i].pszGetUrl
);

        // patch
        char szBuf[100];

        struct curl_slist *headers=NULL;
        snprintf(szBuf, 100, "User-Agent: curl");
        headers = curl_slist_append(headers, szBuf);
        curl_easy_setopt(http_handle, CURLOPT_HTTPHEADER, headers);
        // end patch 

Best regards,
Bart


Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the mapserver-users mailing list