Roxen.git / server / etc / modules / Roxen.pmod

version» Context lines:

Roxen.git/server/etc/modules/Roxen.pmod:1368:   //! eight bit chars and wider. All variable names and values in   //! @[variables] are thoroughly encoded using @[http_encode_url] so   //! they should not be encoded in any way to begin with.   {    // If the URL is a local relative URL we make it absolute.    url = fix_relative(url, id);       // Add protocol and host to local absolute URLs.    if (has_prefix (url, "/")) {    if(id) { -  Standards.URI uri = Standards.URI(id->url_base()); -  -  // Handle proxies -  string xf_proto = id->request_headers["x-forwarded-proto"]; -  string xf_host = id->request_headers["x-forwarded-host"]; -  -  if (xf_proto && xf_host) { -  uri = Standards.URI(xf_proto + "://" + xf_host + uri->path); -  } -  else if (xf_host) { -  uri = Standards.URI(uri->scheme + "://" + xf_host + uri->path); -  } -  else if (xf_proto) { -  uri = Standards.URI(xf_proto + "://" + uri->host + ":" + uri->port + uri->path); -  } -  -  url = (string)uri + url[1..]; +  url = (string)Standards.URI(url, id->url_base());    if (!prestates) prestates = id->prestate;    }    else {    // Ok, no domain present in the URL and no ID object given.    // Perhaps one should dare throw an error here, but since most    // UA can handle the redirect it is nicer no to.    }    }       if(prestates && sizeof(prestates))