a7b1f1aabe52d0c23b1148c20958cd7da201039e
max
  Fri Aug 21 07:49:15 2015 -0700
simpliying code and fixing a bug where there was one slash too many, no
need for npu here. refs #15113

diff --git src/hg/hgTracks/extTools.c src/hg/hgTracks/extTools.c
index 50c2ce9..b29c480 100644
--- src/hg/hgTracks/extTools.c
+++ src/hg/hgTracks/extTools.c
@@ -163,52 +163,57 @@
 
 boolean submitDone = FALSE;
 for (slp=et->params; slp!=NULL; slp=slp->next)
     {
     char* val = slp->val;
     if (sameWord(val, "$db"))
         val = db;
     if (sameWord(val, "$position"))
         val = pos;
     if (sameWord(val, "$returnUrl"))
         {
         // get the full URL of this hgTracks page, so external page can construct a custom track
         // and link back to us
         char* host = getenv("HTTP_HOST");
         char* reqUrl = getenv("REQUEST_URI");
-
-        struct netParsedUrl npu;
-        netParseUrl(reqUrl, &npu);
-        safecpy(npu.protocol, sizeof(npu.protocol), "http");
-        safecpy(npu.host, sizeof(npu.host), host);
         // remove everything after ? in URL
-        char *e = strchr(npu.file, '?');
+        char *e = strchr(reqUrl, '?');
         if (e) *e = 0; 
-        val = urlFromNetParsedUrl(&npu);
+
+        char url[4000];
+        // cannot find a way to find out if the request came in via http or https
+        safef(url, sizeof(url), "http://%s%s", host, reqUrl);
+        val = url;
         }
     // half the current window size
     if (stringIn("$halfLen", val))
         {
         char buf[64];
         safef(buf, sizeof(buf), "%d", len/2);
         val = replaceChars(val, "$halfLen", buf);
         }
-    if (sameWord(val, "$seq"))
+    if (sameWord(val, "$seq") || sameWord(val, "$faSeq"))
         {
         static struct dnaSeq *seq = NULL;
         seq = hDnaFromSeq(db, chromName, winStart, winEnd, dnaLower);
+        if (sameWord(val, "$seq"))
             val = seq->dna;
+        else
+            {
+            val = catTwoStrings(">sequence\n",seq->dna);
+            freez(&seq);
+            }
         }
     // any remaining $-expression might be one of the general ones
     if (stringIn("$", val))
         {
         val = replaceInUrl(val, "", cart, db, chromName, winStart, winEnd, NULL, TRUE);
         }
 
     // output
     if (debug)
         {
         printf("%s: ", slp->name);
         printf("<input name=\"%s\" value=\"%s\"><p>\n", slp->name, val);
         }
     else
         {