43263c78ad44a4b1ab143ddde74e27b47e0e42d5 chinhli Thu Jul 18 23:19:53 2013 -0700 Feature #8922 Remove hard coded "http" string from hgLogin-related code in hgLogin and hgSession diff --git src/hg/hgSession/hgSession.c src/hg/hgSession/hgSession.c index 9daaafe..555cbaf 100644 --- src/hg/hgSession/hgSession.c +++ src/hg/hgSession/hgSession.c @@ -149,47 +149,39 @@ char path[512]; char buf[512]; char *ptr = NULL; safef(path, sizeof(path), "%s", cgiScriptName()); ptr = strrchr(path, '/'); if (ptr == NULL) path[0] = '\0'; else *(ptr+1) = '\0'; safef(buf, sizeof(buf), "%s%s", path, "hgTracks"); thePath = cloneString(buf); } return thePath; } -char *appendSForHttps() -/* if running on https, add the letter s to the url protocol */ -{ -if (cgiServerHttpsIsOn()) - return "s"; -return ""; -} - void addSessionLink(struct dyString *dy, char *userName, char *sessionName, boolean encode) /* Add to dy an URL that tells hgSession to load a saved session. * If encode, cgiEncodeFull the URL. */ { struct dyString *dyTmp = dyStringNew(1024); dyStringPrintf(dyTmp, "http%s://%s%s?hgS_doOtherUser=submit&" "hgS_otherUserName=%s&hgS_otherUserSessionName=%s", - appendSForHttps(), cgiServerNamePort(), destAppScriptName(), userName, sessionName); + cgiAppendSForHttps(), cgiServerNamePort(), destAppScriptName(), userName, sessionName); if (encode) { dyStringPrintf(dy, "%s", cgiEncodeFull(dyTmp->string)); } else { dyStringPrintf(dy, "%s", dyTmp->string); } dyStringFree(&dyTmp); } char *getSessionLink(char *encUserName, char *encSessionName) /* Form a link that will take the user to a bookmarkable page that * will load the given session. */ { @@ -209,31 +201,31 @@ "body=Here is a UCSC browser session I%%27d like to share with " "you:%%20", cgiDecodeClone(encSessionName)); addSessionLink(dy, encUserName, encSessionName, TRUE); dyStringPrintf(dy, "\">Email\n"); return dyStringCannibalize(&dy); } void addUrlLink(struct dyString *dy, char *url, boolean encode) /* Add to dy an URL that tells hgSession to load settings from the given url. * If encode, cgiEncodeFull the whole thing. */ { struct dyString *dyTmp = dyStringNew(1024); char *encodedUrl = cgiEncodeFull(url); dyStringPrintf(dyTmp, "http%s://%s%s?hgS_doLoadUrl=submit&hgS_loadUrlName=%s", - appendSForHttps(), cgiServerNamePort(), destAppScriptName(), encodedUrl); + cgiAppendSForHttps(), cgiServerNamePort(), destAppScriptName(), encodedUrl); if (encode) { dyStringPrintf(dy, "%s", cgiEncodeFull(dyTmp->string)); } else { dyStringPrintf(dy, "%s", dyTmp->string); } freeMem(encodedUrl); dyStringFree(&dyTmp); } char *getUrlLink(char *url) /* Form a link that will take the user to a bookmarkable page that * will load the given url. */ @@ -512,31 +504,31 @@ printf("