Branch: Tag:

2010-03-08

2010-03-08 16:09:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Support redirects with to relative urls. Fixes [bug 5310].

Rev: server/modules/tags/insert_cached_href.pike:1.29

7:   //<locale-token project="mod_insert_cached_href">LOCALE</locale-token>   #define LOCALE(X,Y) _DEF_LOCALE("mod_insert_cached_href",X,Y)    - constant cvs_version = "$Id: insert_cached_href.pike,v 1.28 2009/12/14 13:37:03 jonasw Exp $"; + constant cvs_version = "$Id: insert_cached_href.pike,v 1.29 2010/03/08 16:09:20 grubba Exp $";      constant thread_safe = 1;   constant module_type = MODULE_TAG;
197:    DWRITE("Following redirect from " + (string)client->url +    " to " + location);    +  // Normalize; Some sites (dn.se) use relative locations. +  location = (string)Standards.URI(location, client->url); +     args["cached-href"] = location;    HTTPClient new_client = HTTPClient(args, header);   
213:    DWRITE("Following redirect from " + (string)new_client->url +    " to " + location);    +  location = (string)Standards.URI(location, new_client->url); +     args["cached-href"] = location;    new_client = HTTPClient(args, header);    new_client->orig_url = (string)client->url;
242:    DWRITE("Following redirect from " + (string)client->url +    " to " + location);    +  // Normalize; Some sites (dn.se) use relative locations. +  location = (string)Standards.URI(location, client->url); +     args["cached-href"] = location;    HTTPClient new_client = HTTPClient(args, header);