Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix CookieTest_p formatting (output of <br> as text), change to dataoutput only by servlet, leave formatting to html. + removed link to obsolete env/grafics gif

reger036c1dc6efa7
diff --git a/htroot/CookieTest_p.html b/htroot/CookieTest_p.html
index 324085ac9..ecb1d0c88 100644
--- a/htroot/CookieTest_p.html
+++ b/htroot/CookieTest_p.html
@@ -28,7 +28,7 @@
</fieldset>
</form>
<hr />
- <p>Cookies at this browser:</p>
+ <h3>Cookies at this browser:</h3>
<p>
<script type="text/javascript">
<!--
@@ -39,16 +39,16 @@
#(cookiesout)#
::
<hr />
- <p>Cookies coming to server:</p>
+ <h3>Cookies coming to server:</h3>
#(/cookiesout)#
<p>#{cookiesout}#
- #[string]#
+ #[string]#<br />
#{/cookiesout}#</p>
#(cookiesin)#
::
<hr />
- <p>Cookies server sent:</p>
+ <h3>Cookies server sent:</h3>
#(/cookiesin)#
<p>#{cookiesin}#
#[name]# = #[value]#
@@ -57,7 +57,6 @@
<p class="info">YaCy is a GPL'ed project
with the target of implementing a P2P-based global search engine.<br />
Architecture (C) by Michael Peter Christen,
- <img src="env/grafics/mcemailh.gif" alt="Mail-Adresse von Michael Peter Christen" />
</p>
#%env/templates/footer.template%#
</body>
diff --git a/htroot/CookieTest_p.java b/htroot/CookieTest_p.java
index afb5ec832..64d5e3db3 100644
--- a/htroot/CookieTest_p.java
+++ b/htroot/CookieTest_p.java
@@ -84,8 +84,14 @@ public class CookieTest_p {
//header.
}
- prop.put("cookiesout", "1");
- prop.putHTML("cookiesout_0_string", header.getHeaderCookies().replaceAll(";",";<br />"));
+ //prop.put("cookiesout", "1");
+ String[] cookielst = header.getHeaderCookies().split(";");
+ int i = 0;
+ for (String singleco : cookielst) {
+ prop.putHTML("cookiesout_" + i + "_string", singleco + ";"); // output with ";" for compatiblity with cookiesin
+ i++;
+ }
+ prop.put("cookiesout", i);
return prop;
}
}
diff --git a/source/net/yacy/cora/protocol/HeaderFramework.java b/source/net/yacy/cora/protocol/HeaderFramework.java
index 3c0f1fe62..5048577c8 100644
--- a/source/net/yacy/cora/protocol/HeaderFramework.java
+++ b/source/net/yacy/cora/protocol/HeaderFramework.java
@@ -750,6 +750,12 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
{
setCookie( name, value, null, null, null, false);
}
+
+ /**
+ * Gets the header entry "Cookie"
+ *
+ * @return String with cookies separated by ';'
+ */
public String getHeaderCookies(){
final Iterator<Map.Entry<String, String>> it = entrySet().iterator();
while(it.hasNext())