Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-11-18
22:21 • Ticket [1358369fff] geturl http://192.168.0.2/test/test.php?userid=sip:[email protected]... artifact: cb506637d7 user: dkf
21:01 • Ticket [1358369fff]: 4 changes artifact: 59e02dcb1e user: dkf
21:01 • Add attachment httpparse.diff to ticket [1358369fff] artifact: 9eacfd6115 user: dkf
21:01 • Ticket [1358369fff] geturl http://192.168.0.2/test/test.php?userid=sip:[email protected]... artifact: b1c3bdde3a user: dkf
21:01 • Closed ticket [1358369fff]. artifact: 021b39207a user: dkf
07:07 • Open ticket [1358369fff]. artifact: a198a660e5 user: dkf
01:30 • Ticket [1358369fff]: 4 changes artifact: a8e9612e6b user: hobbs
01:30 • Ticket [1358369fff]: 1 change artifact: 54b728718c user: hobbs
2005-11-17
18:22 • Ticket [1358369fff]: 4 changes artifact: b06529c4da user: dkf
02:41 • Ticket [1358369fff]: 2 changes artifact: ef48f6e278 user: hobbs
02:41 • Closed ticket [1358369fff]. artifact: 3a408fbd9f user: hobbs
2005-11-16
19:35 • New ticket [1358369fff]. artifact: 9836b02118 user: xiaotaow

geturl http://192.168.0.2/test/test.php?userid=sip:[email protected]

Closed / Fixed1358369fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-11-16 19:35:29
http::geturl
http://192.168.0.2/test/test.php?userid=sip:[email protected]

will report an error. 

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

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

-Xiaotao
hobbsplain2005-11-17 02:41:11
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:[email protected]
userid=sip%3ax%40abc.com

that is proper URL formatting.
hobbs Ticket [1358369fff]: 2 changes [History diff]2005-11-17 02:41:13
dkfplain2005-11-17 18:22:57
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.
hobbs Ticket [1358369fff]: 1 change [History diff]2005-11-18 01:30:01
hobbsplain2005-11-18 01:30:02
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.
dkfplain2005-11-18 07:07:23
Logged In: YES 
user_id=79902

Reopening to stop me from losing the issue...
dkfplain2005-11-18 21:01:12
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.
dkf Ticket [1358369fff]: 2 changes [History diff]2005-11-18 21:01:13
dkfplain2005-11-18 21:01:15
File Added - 156758: httpparse.diff
dkfplain2005-11-18 22:21:38
Logged In: YES 
user_id=79902

backported after prodding from dgp
Log in (anonymous is fine) to add a comment.

Attachments: