pike.git / lib / modules / Standards.pmod / URI.pike

version» Context lines:

pike.git/lib/modules/Standards.pmod/URI.pike:256:    *    * An implementation should accept uppercase letters as equivalent    * to lowercase in scheme names (e.g., allow "HTTP" as well as    * "http") for the sake of robustness but should only produce    * lowercase scheme names for consistency.    */    scheme = lower_case(scheme);    }    DEBUG("Found scheme %O", scheme);    +  // DWIM for "www.cnn.com" style input, when parsed in the context of +  // base "http://". +  if( !scheme && this_program::base_uri?->scheme && +  !sizeof(this_program::base_uri->authority) ) +  { +  uri = "//"+uri; +  } +     // Parse authority/login    //    // hier-part = "//" authority path-abempty / path-absolute    // / path-rootless / path-empty    if(sscanf(uri, "//%[^/]%s", authority, uri))    {    DEBUG("Found authority %O", authority);    int q = search(authority, "?", search(authority, "@")+1);    if (q >= 0) {    // There's a question mark in the host and port section