about summary refs log tree commit diff stats
path: root/src/LYGetFile.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-11-18 04:13:09 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1999-11-18 04:13:09 -0500
commit45f1aadc261561566cd074da1d9b0fb21a6ad78c (patch)
treeb1d2c414300b50815acb7b986077556e5dda712d /src/LYGetFile.c
parent0f88481e93b50612489cc8e5b1ca365196439373 (diff)
downloadlynx-snapshots-45f1aadc261561566cd074da1d9b0fb21a6ad78c.tar.gz
snapshot of project "lynx", label v2-8-3dev_15
Diffstat (limited to 'src/LYGetFile.c')
-rw-r--r--src/LYGetFile.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/LYGetFile.c b/src/LYGetFile.c
index 9a80861c..8649a7c5 100644
--- a/src/LYGetFile.c
+++ b/src/LYGetFile.c
@@ -385,25 +385,44 @@ Try_Redirected_URL:
 #endif /* DIRED_SUPPORT */
 
 		}
+
 		if (LYNoRefererHeader == FALSE &&
 		    LYNoRefererForThis == FALSE) {
+		    char *ref_url = HTLoadedDocumentURL();
+		    if (!strncmp(ref_url, "LYNXIMGMAP:", 11))
+			ref_url += 11;
 		    if (no_filereferer == TRUE &&
-			!strncmp(HTLoadedDocumentURL(), "file:", 5)) {
+			!strncmp(ref_url, "file:", 5)) {
 			LYNoRefererForThis = TRUE;
 		    }
 		    if (LYNoRefererForThis == FALSE &&
-			(cp = strchr(HTLoadedDocumentURL(), '?')) != NULL &&
-		    strchr(cp, '=') != NULL) {
+			(cp = strchr(ref_url, '?')) != NULL &&
+			strchr(cp, '=') != NULL) {
 			/*
 			 *  Don't send a Referer header if the URL is
 			 *  the reply from a form with method GET, in
 			 *  case the content has personal data (e.g.,
 			 *  a password or credit card number) which
 			 *  would become visible in logs. - FM
+			 *
+			 *  Changed 1999-11-01 to be controlled by
+			 *  REFERER_WITH_QUERY option. - kw
 			 */
-			LYNoRefererForThis = TRUE;
+			if (LYRefererWithQuery == 'S') { /* SEND */
+			    StrAllocCopy(LYRequestReferer, ref_url);
+			} else if (LYRefererWithQuery == 'P') { /* PARTIAL */
+			    FREE(LYRequestReferer); /* just to be sure */
+			    LYRequestReferer = HTParse(ref_url, "",
+		PARSE_ACCESS|PARSE_HOST|PARSE_STRICTPATH|PARSE_PUNCTUATION);
+			} else { /* Everyhting else - don't send Referer */
+			    LYNoRefererForThis = TRUE;
+			}
 			cp = NULL;
+		    } else if (LYNoRefererForThis == FALSE) {
+			StrAllocCopy(LYRequestReferer, ref_url);
 		    }
+		} else {
+		    StrAllocCopy(LYRequestReferer, HTLoadedDocumentURL());
 		}
 		if (url_type == LYNXHIST_URL_TYPE) {
 		    /*