Maurizio Marini wrote:

Previous mod_proxy release doesn't carry all headers_out across redirect;
I have patched proxy_http.c in apache 1.3.23

Is this fix applied to the code yet?

In proxy_http.c u find:

 /* handle the ProxyPassReverse mappings */
    if ((urlstr = ap_table_get(resp_hdrs, "Location")) != NULL)
      ap_table_set(resp_hdrs, "Location", proxy_location_reverse_map(r, 
urlstr));
    if ((urlstr = ap_table_get(resp_hdrs, "URI")) != NULL)
      ap_table_set(resp_hdrs, "URI", proxy_location_reverse_map(r, urlstr));
    if ((urlstr = ap_table_get(resp_hdrs, "Content-Location")) != NULL)
      ap_table_set(resp_hdrs, "Content-Location", proxy_location_reverse_map(r 
, urlstr));

resp_hdrs doesn't containd Set-Cookie :(
They have Location, URI & Content-Location

The purpose of the above lines is to rewrite the above three lines as specified in the ProxyPassReverse directive. Cookies are passed as-is. As you can see, the headers are lifted from resp_hdrs and returned to resp_hdrs. Other headers (like cookies) remain unaltered, so there is no problem there.


then resp_hdrs is copied onto r->headers_out:
proxy_http.c apache 1.3.23:
    /* Setup the headers for our client from upstreams response-headers */
    ap_overlap_tables(r->headers_out, resp_hdrs, AP_OVERLAP_TABLES_SET);

After this, cookies are missed.

This is because of AP_OVERLAP_TABLES_SET. As each cookie is copied across, it obliterates and previous "cookie" headers, thus you only end up with the last cookie. This problem is fixed in v1.3.26.


My patch save cookie before ap_overlap_tables, and then add them to r->headers_out

This only fixes the problem for cookies, where the problem exists for headers in general.


in proxy_http.c apache 1.3.26 u find:
    /* Setup the headers for our client from upstreams response-headers */
    ap_proxy_table_replace(r->headers_out, resp_hdrs);

If Graham is right (as I hope) using ap_proxy_table_replace instead of 
ap_overlap_tables
does fix the cookies problem (is it a bug? i dunno..)

The replace function was created to "replace an existing header if it exists, but make sure that multiple headers are not obliterated during the copy", thus fixing the problem.


Regards,
Graham
--
-----------------------------------------
[EMAIL PROTECTED] "There's a moon
over Bourbon Street
tonight..."




Reply via email to