#3303 geturl http://192.168.0.2/test/test.php?userid=sip:x@abc.com

obsolete: 8.4.11
closed-fixed
5
2005-11-18
2005-11-16
Xiaotao Wu
No

http::geturl
http://192.168.0.2/test/test.php?userid=sip:x@abc.com

will report an error.

The regular expression
set exp
{^(([^:]*)://)?([^@]+@)?([^/:]+)(:([0-9]+))?(/.*)?$}

will get confused by the '@' in the URL.

-Xiaotao

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-16

    Logged In: YES
    user_id=72656

    That is not a valid geturl request. The URL is not strictly
    valid - it should be encoded, which http provides the
    functions for. The query part should be formed by:

    (Tcl) 50 % http::formatQuery userid sip:x@abc.com
    userid=sip%3ax%40abc.com

    that is proper URL formatting.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-16
    • status: open --> closed-invalid
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    On the other hand, handling URLs more robustly is a good
    thing anyway. Tests indicate that the RE:
    {(?x)
    ^
    (?: (\w+) : ) # <protocol>
    (?: //
    (?: ([^@/:#?]+) (?: : ([^@/#?]+) )? @ )? # <user> <pass>
    ( [^/:#?]+ ) # <host>
    (?: : (\d+) )? # <port>
    )?
    ( / [^#]* )? # <path> (including query)
    (?: \# (.*) )? # <fragment>
    $
    }

    offers both robust parsing (including of a number of rarely
    used parts of the URL spec) and yet is also fairly easy to
    understand. It also doesn't capture bits that aren't
    interesting.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-17
    • assigned_to: hobbs --> dkf
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-17

    Logged In: YES
    user_id=72656

    Donal - you can reopen if you want to provide a better RE,
    but make sure to add more tests along with it. Regardless,
    better conformance to the x-url-encoding for users should be
    directed.

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Reopening to stop me from losing the issue...

     
  • Donal K. Fellows

    • status: closed-invalid --> open-invalid
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Added improved validator (I think it is compliant with RFC
    3986, which I believe to be the most up-to-date URI spec) to
    HEAD using attached patch.

    I don't plan to backport this patch.

     
  • Donal K. Fellows

    • status: open-invalid --> closed-fixed
     
  • Donal K. Fellows

    UniDiff vs HEAD

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    backported after prodding from dgp

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks