src/lib/net.c 1.76
1.76 2009/11/10 23:23:58 angie
Force keys to uppercase for netUrlHead's hash, for case-insensitive lookup. Also, in udcInfoViaHttp, accept Date: as a poor substitute for missing Last-Modified:.
Index: src/lib/net.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/net.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -b -B -U 4 -r1.75 -r1.76
--- src/lib/net.c 20 Oct 2009 22:39:47 -0000 1.75
+++ src/lib/net.c 10 Nov 2009 23:23:58 -0000 1.76
@@ -901,9 +901,10 @@
int netUrlHead(char *url, struct hash *hash)
/* Go get head and return status. Return negative number if
* can't get head. If hash is non-null, fill it with header
- * lines, including hopefully Content-Type: */
+ * lines with upper cased keywords for case-insensitive lookup,
+ * including hopefully CONTENT-TYPE: . */
{
int sd = netOpenHttpExt(url, "HEAD", NULL);
int status = EIO;
if (sd >= 0)
@@ -926,9 +927,9 @@
{
word = nextWord(&line);
if (word == NULL)
break;
- hashAdd(hash, word, cloneString(skipLeadingSpaces(line)));
+ hashAdd(hash, strUpper(word), cloneString(skipLeadingSpaces(line)));
}
}
}
}