Branch: Tag:

2009-04-16

2009-04-16 10:42:36 by Tobias Liin <liin@roxen.com>

Ported from 4.5: Response to improvement request #4710.

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

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.23 2008/09/09 11:21:46 liin Exp $"; + constant cvs_version = "$Id: insert_cached_href.pike,v 1.24 2009/04/16 10:42:36 liin Exp $";      constant thread_safe = 1;   constant module_type = MODULE_TAG;
711:       if(!request_headers)    request_headers = ([]); +  +  string host_header; +  if (url->scheme == "http" && url->port == 80) +  host_header = sprintf("%s", url->host); +  else +  host_header = sprintf("%s:%d", url->host, url->port); +     mapping default_headers = ([    "user-agent" : "Mozilla/4.0 compatible (Pike HTTP client)", -  "host" : sprintf("%s:%d", url->host, url->port) ]); +  "host" : host_header ]);       if(url->user || url->passwd)    default_headers->authorization = "Basic "