Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.1038 2009/07/07 11:57:39 jonasw Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1039 2009/07/15 15:28:03 grubba Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:2522:   //! used for port matching, i.e. what   //! @[roxen.Protocol.find_configuration_for_url] expects.   {    if (!sizeof (url - " " - "\t")) return "";       Standards.URI ui = Standards.URI(url);    string host = ui->host;       if (lower_case (host) == "any" || host == "::")    host = "*"; -  else +  else { +  // Note: zone_to_ascii() can throw errors on invalid hostnames. +  if (catch {    // FIXME: Maybe Standards.URI should do this internally?    host = lower_case(Standards.IDNA.zone_to_ascii (host)); -  +  }) { +  host = lower_case(host); +  } +  }       if (has_value (host, ":"))    if (string h = port_match_form ?    Protocols.IPv6.normalize_addr_basic (host) :    Protocols.IPv6.normalize_addr_short (host)) {    ui->host = h;    host = "[" + h + "]";    }       string protocol = ui->scheme;