www-modproxy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Marini <mau...@datalogica.com>
Subject taking cookie across mod_proxy
Date Sun, 16 Jun 2002 11:48:44 GMT
Hi there!	

I'm integrating mod_pubcookie (WEBISO) in a server acting as ProxyPass & 
ProxyPassReverse for some appl server behind it.
My concern is that mod_pubcookie send session cookies to browser during 4 
phase.
Then at handler stage, mod_proxy ignore these fields in headers_out, carrying 
on only a few of them:

mod_proxy in apache 2.0.36:

     804         /* munge the Location and URI response headers according to
     805          * ProxyPassReverse
     806          */
     807         {
     808             const char *buf;
     809             if ((buf = apr_table_get(r->headers_out, "Location")) != 
NULL) {
     810                 apr_table_set(r->headers_out, "Location",
     811                               ap_proxy_location_reverse_map(r, conf, 
buf));
     812             }
     813             if ((buf = apr_table_get(r->headers_out, 
"Content-Location")) != NULL) {
     814                 apr_table_set(r->headers_out, "Content-Location",
     815                               ap_proxy_location_reverse_map(r, conf, 
buf));
     816             }
     817             if ((buf = apr_table_get(r->headers_out, "URI")) != NULL) 
{
     818                 apr_table_set(r->headers_out, "URI",
     819                               ap_proxy_location_reverse_map(r, conf, 
buf));
     820             }
     821         }


mod_proxy in apache 1.3.2x:


     497  * HTTP/1.0 requires us to accept 3 types of dates, but only generate
     498  * one type
     499  */
     500     if ((datestr = ap_table_get(resp_hdrs, "Date")) != NULL)
     501         ap_table_set(resp_hdrs, "Date", ap_proxy_date_canon(p, 
datestr));
     502     if ((datestr = ap_table_get(resp_hdrs, "Last-Modified")) != NULL)
     503         ap_table_set(resp_hdrs, "Last-Modified", 
ap_proxy_date_canon(p, datestr));
     504     if ((datestr = ap_table_get(resp_hdrs, "Expires")) != NULL)
     505         ap_table_set(resp_hdrs, "Expires", ap_proxy_date_canon(p, 
datestr));
     506
     507     if ((datestr = ap_table_get(resp_hdrs, "Location")) != NULL)
     508         ap_table_set(resp_hdrs, "Location", 
proxy_location_reverse_map(r, datestr));
     509     if ((datestr = ap_table_get(resp_hdrs, "URI")) != NULL)
     510         ap_table_set(resp_hdrs, "URI", proxy_location_reverse_map(r, 
datestr));




Now, I've developed a patch for 1.3.2x that:
1) point to topmost request
2) extract from headers_out Set-cookie elts, if any of them exist
3) add them to current request

     512     ap_table_get_next(r->headers_out, NULL);
     513     i=0;
     514      while( elts = ap_table_get_next(r->headers_out, "Set-Cookie")){
     515              newelts[i]=ap_palloc(r->pool, strlen(elts)+1);
     516              strcpy(newelts[i],elts);
     517              i++;
     518          }
     519
     520         for ( j = 0; j < i; j++ ){
     521                  ap_log_rerror(APLOG_MARK, 
APLOG_NOERRNO|APLOG_DEBUG,r,"handler_auth_ok[%d]: current r->newelts[%d]: 
%s\n",
     522                                 __LINE__, j, newelts[j]);
     523                 ap_table_add(resp_hdrs, "Set-Cookie", newelts[j]);
     524         }
     525

The patch I developed, for now,  applies to version 1.3.2x, only.
The patch is suited for our goals, only, i fear.

I'm wondering  if I've violated any rfc, doing this.
If not, can be this patch submitted to 1.3.24 cvs?
Thnx in advance for your consideration,
any suggestion will be very very appreciated.

Maurizio Marini                 
CosT Srl                        Via Longhi, 13 - 20137 Milano
Tel. Direct (+39)02 45446 202   Fax +39-2-45446333
mailto:maumar@datalogica.com    GSM +39-335-8259739







Mime
View raw message