You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by je...@apache.org on 2001/08/18 06:00:23 UTC
cvs commit: apr-util/uri apr_uri.c
jerenkrantz 01/08/17 21:00:22
Modified: . CHANGES
uri apr_uri.c
Log:
apr_uri_unparse_components can unparse components into an invalid
URI. If the components contain either a user or password, the
unparsed URI will always contain an '@' symbol. This is incorrect,
since the UNP_OMITPASSWORD and UNP_OMITUSER flags can affect
this functionality. I.e. if the components contain either a user
or password, and flags to omit both the user and password from the
unparsed URI are given, the output should contain no '@' symbol.
RFC 2396 says:
server = [ [ userinfo "@" ] hostport ]
When we omit the userinfo portion (i.e. both OMITPASSWORD and OMITUSER
are set), we should omit the "@" character.
Submitted by: Jon Travis <jt...@covalent.net>
Reviewed by: Justin Erenkrantz
Revision Changes Path
1.29 +4 -0 apr-util/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr-util/CHANGES,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- CHANGES 2001/08/08 05:58:15 1.28
+++ CHANGES 2001/08/18 04:00:22 1.29
@@ -1,5 +1,9 @@
Changes with APR-util b1
+ *) Fix URI unparse function to handle the case where it would place a @
+ when both the username and password were present but omitted.
+ [Jon Travis <jtravis@covalent.net]
+
*) Added apr_xml_parse_file() routine and a testxml program.
[Ian Holsman <ia...@cnet.com>]
1.7 +3 -1 apr-util/uri/apr_uri.c
Index: apr_uri.c
===================================================================
RCS file: /home/cvs/apr-util/uri/apr_uri.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- apr_uri.c 2001/06/13 22:56:23 1.6
+++ apr_uri.c 2001/08/18 04:00:22 1.7
@@ -139,7 +139,9 @@
(uptr->password && !(flags & UNP_OMITPASSWORD))
? ((flags & UNP_REVEALPASSWORD) ? uptr->password : "XXXXXXXX")
: "",
- "@", NULL);
+ ((uptr->user && !(flags & UNP_OMITUSER)) ||
+ (uptr->password && !(flags & UNP_OMITPASSWORD))) ? "@" : "",
+ NULL);
/* Construct scheme://site string */
if (uptr->hostname) {