[Mapserver-dev] RE: [Mapserver-users] additional parameters for WMS  layer

John.Hockaday at ga.gov.au John.Hockaday at ga.gov.au
Mon May 19 20:37:07 EDT 2003


Mike,

I feel what you are asking is an implementation problem and not a mapserv development issue.  I wouldn't like to see mapserv develop some WMS parameters that are not OGC compliant.  Not everyone allows cookies on their browser for security reasons and tying mapserv into a particular type of implementation would be dangerous unless it was compliant to the OGC specification.

I think that you could use hidden input types to pass the extra parameters backwards and forwards to your CGI scripts.  However, I would be very surprised if the OGC specifications have not already catered for these extra parameters.

Just my initial thoughts on the idea.

John

> -----Original Message-----
> From: Mike V. Andreev [mailto:andreev at d902.iki.rssi.ru] 
> Sent: Saturday, 17 May 2003 3:35 
> To: mapserver-dev at lists.gis.umn.edu
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: [Mapserver-users] additional parameters for WMSÂ  layer
> 
> 
> Hello
> 
> I have mapserever compiled with WMS client support and I use map file
> with defined WMS layer. This layer is a http reference to my 
> perl script
> on the same http server. This script understand OGC WMS parameters in
> query string and can create maps whith information from some database.
> But to  create sensible map this script need additional information in
> request. I wanted to use http cookies to store that parameters. But I
> have a problem here. Then my client send request to http server with
> mapserver URI request contain proper cookies but after that mapserver
> need to make http request to perl script URI and of couse this request
> contains no cookies.
> 
> So I want to ask two question here:
> 
> 1) Can somebody give me any hits to solve my problem with 
> existing soft?
> 
> 2) I have an idea how to extend mapserver functionality so it 
> be able to
> solve my problem. So I want to ask what do you people think about it.
> 
> There is my proposal: each layer object could contain boolean 
> parameter
> http_cookies_forwad (disabled by default). So if this featcher enabled
> in layer with connectiontype equal to 'WMS' (and may be 
> 'WFS') than when
> mapserver make http request to proper URL it sends additional http
> headers: 1) Cookie - header with cookies client send to 
> mapserver and 2)
> X-Forwarder-For - header with original client ip (as far as mapserver
> can determine it).
> 
> 
> Just to illustrate my idea I've made simple patch to maphttp.c. I used
> today's (2003-05-16) nightly build. This patch contains only
> functionality for sending proper http request. There is no 
> any stuff to
> support new feature in layreObj but I think whole idea is clear.
> 
> 
> 
> 
> 81a82,83
> > #define HTTP_COOKIES_FORWARDING 1
> >
> 243a246,247
> >     char     *tmp_env_read, *strBuf = NULL;
> >     struct curl_slist *slist=NULL;
> 366a371,392
> >         /* If we need to forward http cookies to server  */
> >         if( HTTP_COOKIES_FORWARDING && (tmp_env_read = 
> curl_getenv( "HTTP_COOKIE" ) ) != NULL ){
> >            /*add cookies to http_handle*/
> >            curl_easy_setopt(http_handle, CURLOPT_COOKIE, 
> tmp_env_read);
> >
> >           /*add X-Forwarded-For header with original client ip */
> >            if( (tmp_env_read = curl_getenv( 
> "HTTP_X_FORWARDED_FOR" ))  == NULL )
> >               if( (tmp_env_read = curl_getenv( 
> "HTTP_FORWARDED" ) ) == NULL )
> >                  if( (tmp_env_read = curl_getenv( 
> "HTTP_CLIENT_IP" ) ) == NULL )
> >                     tmp_env_read = curl_getenv( "REMOTE_ADDR" );
> >
> >            if( tmp_env_read != NULL ){
> > #define HTTP_HEADER_BUF_LENGTH 100
> >               strBuf = (char*)malloc( HTTP_HEADER_BUF_LENGTH );
> >               snprintf( strBuf, HTTP_HEADER_BUF_LENGTH, 
> "X-Forwarded-For: %s", tmp_env_read);
> > #undef HTTP_HEADER_BUF_LENGTH
> >               slist = curl_slist_append( slist, strBuf);
> >               curl_easy_setopt(http_handle, 
> CURLOPT_HTTPHEADER, slist);
> >            }
> >        }
> >
> >
> 554a581,583
> >     if( slist != NULL ){ curl_slist_free_all(slist); }
> >     if( strBuf != NULL ){ free( strBuf ); }
> >
> 556a586,587
> > #undef HTTP_COOKIES_FORWARDING
> >
> 
> 
> -- 
>  ____________________________________________________________
> | Mike Andreev, software engineer andreev at d902.iki.rssi.ru   |
> | SMIS Lab, Space Research Institute http://smis.iki.rssi.ru |
> |____________________________________________________________|
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 




More information about the mapserver-dev mailing list