src/lib/net.c 1.69
1.69 2009/03/03 08:09:46 galt
fixing need for cgiDecode of user and password in url
Index: src/lib/net.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/net.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -b -B -U 4 -r1.68 -r1.69
--- src/lib/net.c 18 Feb 2009 00:33:25 -0000 1.68
+++ src/lib/net.c 3 Mar 2009 08:09:46 -0000 1.69
@@ -12,8 +12,9 @@
#include "hash.h"
#include "net.h"
#include "linefile.h"
#include "base64.h"
+#include "cheapcgi.h"
static char const rcsid[] = "$Id$";
/* Brought errno in to get more useful error messages */
@@ -240,8 +241,9 @@
void netParseUrl(char *url, struct netParsedUrl *parsed)
/* Parse a URL into components. A full URL is made up as so:
* http://user:password@hostName:port/file;byterange=0-499
+ * User and password may be cgi-encoded.
* This is set up so that the http:// and the port are optional.
*/
{
char *s, *t, *u, *v, *w, *x;
@@ -334,8 +336,10 @@
*w = 0;
strncpy(parsed->user, s, sizeof(parsed->user));
strncpy(parsed->password, w+1, sizeof(parsed->password));
}
+ cgiDecode(parsed->user,parsed->user,strlen(parsed->user));
+ cgiDecode(parsed->password,parsed->password,strlen(parsed->password));
s = v+1;
}