ad6d30584193b3be7dc7ca66a01456ac599acb40
max
  Thu Jun 2 10:56:19 2016 -0700
fixing custom tracks bigBed auto-detect to ignore the ? part in the URL, refs #17423

diff --git src/hg/lib/customTrack.c src/hg/lib/customTrack.c
index 045b97d..d7daea2 100644
--- src/hg/lib/customTrack.c
+++ src/hg/lib/customTrack.c
@@ -641,34 +641,39 @@
     {
     safef(buf,sizeof(buf),"compressed://%s %s", fileName,  cFBin);
     /* cgi functions preserve binary data, cart vars have been
      *  cloneString-ed  which is bad for a binary stream that might
      * contain 0s  */
     }
 else
     {
     char *cF = cartOptionalString(cart, fileVar);
     safef(buf,sizeof(buf),"compressed://%s %lu %lu",
         fileName, (unsigned long) cF, (unsigned long) strlen(cF));
     }
 return cloneString(buf);
 }
 
-char* customTrackTypeFromBigFile(char *fileName)
+char* customTrackTypeFromBigFile(char *url)
 /* return most likely type for a big file name or NULL,
- * has to be freed */
+ * has to be freed. */
 {
+// pull out file part from the URL, strip off the query part after "?"
+char fileName[2000];
+safecpy(fileName, sizeof(fileName), url);
+chopSuffixAt(fileName, '?');
+
 // based on udc cache dir analysis by hiram in rm #12813
 if (endsWith(fileName, ".bb") || endsWith(fileName, ".bigBed") || endsWith(fileName, ".bigbed"))
     return cloneString("bigBed");
 if (endsWith(fileName, ".bw") || endsWith(fileName, ".bigWig") ||  
             endsWith(fileName, ".bigwig") || endsWith(fileName, ".bwig"))
     return cloneString("bigWig");
 if (endsWith(fileName, ".bam"))
     return cloneString("bam");
 if (endsWith(fileName, ".vcf.gz"))
     return cloneString("vcfTabix");
 return NULL;
 }
 
 boolean customTrackIsBigData(char *fileName)
 /* Return TRUE if fileName has a suffix that we recognize as a bigDataUrl track type. */